This is the reference document for the Atlassian Stash REST API. The REST API is for developers who want to:
Because the REST API is based on open standards, you can use any web development language or command line tool capable of generating an HTTP request to access the API. See the developer documentation for a basic usage example.
If you're already working with the Atlassian SDK, the REST API Browser is a great tool for exploring and experimenting with the Stash REST API.
Stash's REST APIs provide access to resources (data entities) via URI paths. To use a REST API, your application will make an HTTP request and parse the response. The Stash REST API uses JSON as its communication format, and the standard HTTP methods like GET, PUT, POST and DELETE. URIs for Stash's REST API resource have the following structure:
http://host:port/context/rest/api-name/api-version/path/to/resource
For example, the following URI would retrieve a page of the latest commits to the jira repository in the JIRA project on https://stash.atlassian.com.
https://stash.atlassian.com/rest/api/1.0/projects/JIRA/repos/jira/commits
See the API descriptions below for a full list of available resources.
Alternatively we also publish a list of resources in WADL format. It is available here.
Stash uses paging to conserve server resources and limit response size for resources that return potentially large
collections of items. A request to a paged API will result in a values
array wrapped in a JSON object
with some paging metadata, like this:
{ "size": 3, "limit": 3, "isLastPage": false, "values": [ { /* result 0 */ }, { /* result 1 */ }, { /* result 2 */ } ], "start": 0, "filter": null, "nextPageStart": 3 }
Clients can use the limit
and start
query parameters to retrieve the desired number of
results.
The limit
parameter indicates how many results to return per page. Most APIs default to returning
25
if the limit is left unspecified. This number can be increased, but note that a resource-specific
hard limit will apply. These hard limits can be configured by server administrators, so it's always best practice to
check the limit
attribute on the response to see what limit has been applied.
The request to get a larger page should look like this:
http://host:port/context/rest/api-name/api-version/path/to/resource?limit={desired size of page}
For example:
https://stash.atlassian.com/rest/api/1.0/projects/JIRA/repos/jira/commits?limit=1000
The start
parameter indicates which item should be used as the first item in the page of results. All
paged responses contain an isLastPage
attribute indicating whether another page of items exists.
The request to get a subsequent page should look like this:
http://host:port/context/rest/api-name/api-version/path/to/resource?start={start of last page} + {size of last page}
For example:
https://stash.atlassian.com/rest/api/1.0/projects/JIRA/repos/jira/commits?start=25
Important: If more than one page exists (i.e. the response contains
"isLastPage": false
), the response object will also contain a nextPageStart
attribute
which must be used by the client as the start
parameter on the next request.
Identifiers of adjacent objects in a page may not be contiguous, so the start of the next page is not
necessarily the start of the last page plus the last page's size. A client should always use
nextPageStart
to avoid unexpected results from a paged API.
Any authentication that works against Stash will work against the REST API. The prefered authentication methods are HTTP Basic (when using SSL) and OAuth. Other supported methods include: HTTP Cookies and Trusted Applications.
You can find OAuth code samples in several programming languages at bitbucket.org/atlassian_tutorial/atlassian-oauth-examples.
The log-in page uses cookie-based authentication, so if you are using Stash in a browser you can call REST from Javascript on the page and rely on the authentication that the browser has established.
If a request fails due to client error, the resource will return an HTTP response code in the 40x range. These can be broadly categorised into:
HTTP Code | Description |
---|---|
400 (Bad Request) |
One or more of the required parameters or attributes:
|
401 (Unauthorized) |
Either:
|
403 (Forbidden) | Actions are usually "forbidden" if they involve breaching the licensed user limit of the server, or degrading the authenticated user's permission level. See the individual resource documentation for more details. |
404 (Not Found) | The entity you are attempting to access, or the project or repository containing it, does not exist. |
405 (Method Not Allowed) | The request HTTP method is not appropriate for the targeted resource. For example an HTTP GET to a resource that only accepts an HTTP POST will result in a 405. |
409 (Conflict) |
The attempted update failed due to some conflict with an existing resource. For example:
|
415 (Unsupported Media Type) |
The request entity has a Content-Type that the server does not support. Almost all of the
Stash REST API accepts application/json format, but check the individual resource
documentation for more details. Additionally, double-check that you are setting the
Content-Type header correctly on your request (e.g. using
-H "Content-Type: application/json" in cURL).
|
For 400 HTTP codes the response will typically contain one or more validation error messages, for example:
{ "errors": [ { "context": "name", "message": "The name should be between 1 and 255 characters.", "exceptionName": null }, { "context": "email", "message": "The email should be a valid email address.", "exceptionName": null } ] }
The context
attribute indicates which parameter or request entity attribute failed validation. Note
that the context
may be null.
For 401, 403, 404 and 409 HTTP codes, the response will contain one or more descriptive error messages:
{ "errors": [ { "context": null, "message": "A detailed error message.", "exceptionName": null } ] }
A 500 (Server Error) HTTP code indicates an incorrect resource url or an unexpected server error. Double-check the URL you are trying to access, then report the issue to your server administrator or Atlassian Support if problems persist.
Stash allows users to manage their own repositories, called personal repositories. These are repositories associated with the user and to which they always have REPO_ADMIN permission.
Accessing personal repositories via REST is achieved through the normal project-centric REST URLs using the user's slug prefixed by tilde as the project key. E.g. to list personal repositories for a user with slug "johnsmith" you would make a GET to:
http://example.com/rest/api/1.0/projects/~johnsmith/repos
In addition to this, Stash allows access to these repositories through an alternate set of user-centric REST URLs beginning with:
http://example.com/rest/api/1.0/users/~{userSlug}/reposE.g. to list the forks of the repository with slug "nodejs" in the personal project of user with slug "johnsmith" using the regular REST URL you would make a GET to:
http://example.com/rest/api/1.0/projects/~johnsmith/repos/nodejs/forksUsing the alternate URL, you would make a GET to:
http://example.com/rest/api/1.0/users/johnsmith/repos/nodejs/forks
REST-ish endpoint for interacting with Stash
Create a new group.
The authenticated user must have ADMIN permission or higher to call this resource.
parameter | value | description |
---|---|---|
name |
Name of the group. |
Example response representations:
{
"name" : "group-a",
"deletable" : true
}
The newly created group.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
A group with this name already exists.
This is a paged API.
Retrieve a page of groups.
The authenticated user must have PROJECT_ADMIN permission or higher to call this resource.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of groups.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator.
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.
parameter | value | description |
---|---|---|
name |
the name identifying the group to delete |
Example response representations:
{
"name" : "group-a",
"deletable" : true
}
The deleted group.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as the authenticated user has a lower permission level than the group being deleted.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified group does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would lower the authenticated user's permission level.
This is a paged API.
Retrieve a page of users.
The authenticated user must have the PROJECT_ADMIN permission to call this resource.
parameter | value | description |
---|---|---|
filter |
if specified only users with usernames, display name or email addresses containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen",
"directoryName" : "Stash Internal Directory",
"mutableDetails" : true,
"mutableGroups" : true
} ],
"start" : 0,
"filter" : null
}
A page of users.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator.
Update a user's details.
The authenticated user must have the ADMIN permission to call this resource.
Example request representations:
{
"name" : "jcitizen",
"displayName" : "Jane Citizen",
"email" : "jane@example.com"
}
Example response representations:
{
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen",
"directoryName" : "Stash Internal Directory",
"mutableDetails" : true,
"mutableGroups" : true
}
The updated user.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission or has a lower permission level than the user being deleted.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user does not exist.
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.
parameter | value | description |
---|---|---|
name |
the username for the new user |
|
password |
the password for the new user |
|
displayName |
the display name for the new user |
|
emailAddress |
the e-mail address for the new user |
|
addToDefaultGroup |
Default: true |
|
Example response representations:
The user was successfully created.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user is not an administrator.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Adding the user to the default group would exceed the server's license limit.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Another user with the same name already exists.
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.
parameter | value | description |
---|---|---|
name |
the username identifying the user to delete |
Example response representations:
{
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen",
"directoryName" : "Stash Internal Directory",
"mutableDetails" : true,
"mutableGroups" : true
}
The deleted user.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as the authenticated user has a lower permission level than the user being deleted.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as a user can not delete themselves.
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.
Example request representations:
{
"password" : "secret",
"passwordConfirm" : "secret",
"name" : "jcitizen"
}
Example response representations:
The user's password was successfully updated.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission or has a lower permission level than the user being deleted.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user does not exist.
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.
parameter | value | description |
---|---|---|
name |
Example response representations:
The CAPTCHA was successfully cleared.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as the authenticated user has a lower permission level than the group being deleted.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user does not exist.
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.
Example request representations:
{
"context" : "group_a",
"itemName" : "user_a"
}
Example response representations:
The user was added to the group
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would exceed the server's licensing limit, or the groups permissions exceed the authenticated user's permission level.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user or group does not exist.
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.
Example request representations:
{
"context" : "user_a",
"itemName" : "group_a"
}
Example response representations:
The user was added to the group
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would exceed the server's licensing limit, or the groups permissions exceed the authenticated user's permission level.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user or group does not exist.
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.
Example request representations:
{
"context" : "group_a",
"itemName" : "user_a"
}
Example response representations:
The user was removed from the group.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as the group has a higher permission level than the context user.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user or group does not exist.
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.
Example request representations:
{
"context" : "user_a",
"itemName" : "group_a"
}
Example response representations:
The user was removed from the group.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The authenticated user does not have the ADMIN permission.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as the group has a higher permission level than the context user.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user or group does not exist.
This is a paged API.
Retrieves a list of users that are members of a specified group.
The authenticated user must have the PROJECT_ADMIN permission to call this resource.
parameter | value | description |
---|---|---|
context |
the group which should be used to locate members |
|
filter |
Default: |
if specified only users with usernames, display names or email addresses containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen",
"directoryName" : "Stash Internal Directory",
"mutableDetails" : true,
"mutableGroups" : true
} ],
"start" : 0,
"filter" : null
}
A page of users.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator.
This is a paged API.
Retrieves a list of users that are not members of a specified group.
The authenticated user must have the PROJECT_ADMIN permission to call this resource.
parameter | value | description |
---|---|---|
context |
the group which should be used to locate non-members |
|
filter |
Default: |
if specified only users with usernames, display names or email addresses containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen",
"directoryName" : "Stash Internal Directory",
"mutableDetails" : true,
"mutableGroups" : true
} ],
"start" : 0,
"filter" : null
}
A page of users.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator.
This is a paged API.
Retrieves a list of groups the specified user is a member of.
The authenticated user must have the PROJECT_ADMIN permission to call this resource.
parameter | value | description |
---|---|---|
context |
the user which should be used to locate groups |
|
filter |
Default: |
if specified only groups with names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of groups.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator.
This is a paged API.
Retrieves a list of groups the specified user is not a member of.
The authenticated user must have the PROJECT_ADMIN permission to call this resource.
parameter | value | description |
---|---|---|
context |
the user which should be used to locate groups |
|
filter |
Default: |
if specified only groups with names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of groups.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator.
A REST endpoint for retrieving or updating the license.
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.Example response representations:
{
"creationDate" : 1331038800000,
"purchaseDate" : 1331038800000,
"expiryDate" : 1372493732817,
"numberOfDaysBeforeExpiry" : 0,
"maintenanceExpiryDate" : 1372493732817,
"numberOfDaysBeforeMaintenanceExpiry" : 0,
"gracePeriodEndDate" : 1372493732817,
"numberOfDaysBeforeGracePeriodExpiry" : 0,
"maximumNumberOfUsers" : 12,
"unlimitedNumberOfUsers" : false,
"serverId" : "<server ID embedded in license>",
"supportEntitlementNumber" : "<support entitlement number embedded in license>",
"license" : "<encoded license text>",
"status" : {
"serverId" : "<actual server ID>",
"currentNumberOfUsers" : 2
}
}
The currently-installed license.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the license, or the request is anonymous.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
No license has been installed.
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:
Example request representations:
{
"license" : "<encoded license text>"
}
Example response representations:
{
"creationDate" : 1331038800000,
"purchaseDate" : 1331038800000,
"expiryDate" : 1372493732817,
"numberOfDaysBeforeExpiry" : 0,
"maintenanceExpiryDate" : 1372493732817,
"numberOfDaysBeforeMaintenanceExpiry" : 0,
"gracePeriodEndDate" : 1372493732817,
"numberOfDaysBeforeGracePeriodExpiry" : 0,
"maximumNumberOfUsers" : 12,
"unlimitedNumberOfUsers" : false,
"serverId" : "<server ID embedded in license>",
"supportEntitlementNumber" : "<support entitlement number embedded in license>",
"license" : "<encoded license text>",
"status" : {
"serverId" : "<actual server ID>",
"currentNumberOfUsers" : 2
}
}
The newly-installed license.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
No encoded license was provided in the JSON body for the POST.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update the license.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The encoded license could not be decoded, or it is not valid for use on this server. For example, it may be for a different product, or it may have already expired.
Deletes the current mail server configuration.
The authenticated user must have the SYS_ADMIN permission to call this resource.
Example response representations:
The mail server configuration was successfully deleted.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to delete the mail server configuration.
Promote or demote the global permission level of a user. Available global permissions are:
The authenticated user must have:
parameter | value | description |
---|---|---|
name |
the names of the users |
|
permission |
the permission to grant |
Example response representations:
The requested permission was granted.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator or doesn't have the specified permission they are attempting to grant.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would exceed the server's license limits.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level or the currently authenticated user has a lower permission level than the user they are attempting to modify.
Revoke all global permissions for a user.
The authenticated user must have:
parameter | value | description |
---|---|---|
name |
the name of the user |
Example response representations:
All global permissions were revoked from the user.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level or the currently authenticated user has a lower permission level than the user they are attempting to modify.
This is a paged API.
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.
parameter | value | description |
---|---|---|
filter |
Default: |
if specified only user names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"permission" : "ADMIN"
} ],
"start" : 0,
"filter" : null
}
A page of users and their highest global permissions.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator.
Revoke all global permissions for a group.
The authenticated user must have:
parameter | value | description |
---|---|---|
name |
the name of the group |
Example response representations:
All global permissions were revoked from the group.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified group does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level or the currently authenticated user has a lower permission level than the group they are attempting to modify.
This is a paged API.
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.
parameter | value | description |
---|---|---|
filter |
Default: |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"group" : {
"name" : "group_a"
},
"permission" : "ADMIN"
} ],
"start" : 0,
"filter" : null
}
A page of groups and their highest global permissions.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator.
Promote or demote a user's global permission level. Available global permissions are:
The authenticated user must have:
parameter | value | description |
---|---|---|
permission |
the permission to grant |
|
name |
the names of the groups |
Example response representations:
The specified permission was granted to the specified user.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator or doesn't have the specified permission they are attempting to grant.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would exceed the server's license limits.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified group does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level or the currently authenticated user has a lower permission level than the group they are attempting to modify.
This is a paged API.
Retrieve a page of users that have no granted global permissions.
The authenticated user must have ADMIN permission or higher to call this resource.
parameter | value | description |
---|---|---|
filter |
Default: |
if specified only user names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
} ],
"start" : 0,
"filter" : null
}
A page of users that have not been granted any global permissions.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator.
This is a paged API.
Retrieve a page of groups that have no granted global permissions.
The authenticated user must have ADMIN permission or higher to call this resource.
parameter | value | description |
---|---|---|
filter |
Default: |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of groups that have not been granted any global permissions.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator.
Retrieve version information and other application properties.
No authentication is required to call this resource.
Example response representations:
{
"version" : "2.1.0",
"buildNumber" : "20130123103656677",
"buildDate" : "1358897885952000",
"displayName" : "Example.com Stash"
}
The application properties.
This is a paged API.
Retrieve a page of group names.
The authenticated user must have PROJECT_ADMIN permission or higher to call this resource.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 2,
"limit" : 25,
"isLastPage" : true,
"values" : [ "group_a", "group_b" ],
"start" : 0,
"filter" : null
}
A page of group names.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator.
parameter | value | description |
---|---|---|
hookKey |
the complete module key of the hook module |
Retrieve the avatar for the project matching the supplied moduleKey.
parameter | value | description |
---|---|---|
version |
optional version used for HTTP caching only - any non-blank version will result in a large max-age Cache-Control header. Note that this does not affect the Last-Modified header. |
Example response representations:
The avatar of the project matching the supplied projectKey.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
parameter | value | description |
---|---|---|
loggerName |
the name of the logger. |
Retrieve the current log level for a given logger.
The authenticated user must have ADMIN permission or higher to call this resource.
Example response representations:
{
"logLevel" : "DEBUG"
}
The log level of the logger.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to retrieve the log level.
parameter | value | description |
---|---|---|
levelName |
the level to set the logger to. Either TRACE, DEBUG, INFO, WARN or ERROR |
|
loggerName |
the name of the logger. |
Set the current log level for a given logger.
The authenticated user must have ADMIN permission or higher to call this resource.
Example response representations:
The log level was successfully changed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The log level was invalid.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to retrieve the log level.
Retrieve the current log level for the root logger.
The authenticated user must have ADMIN permission or higher to call this resource.
Example response representations:
{
"logLevel" : "DEBUG"
}
The log level of the logger.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to retrieve the log level.
parameter | value | description |
---|---|---|
levelName |
the level to set the logger to. Either TRACE, DEBUG, INFO, WARN or ERROR |
Set the current log level for the root logger.
The authenticated user must have ADMIN permission or higher to call this resource.
Example response representations:
The log level was successfully changed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The log level was invalid.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to retrieve the log level.
Preview the generated html for given markdown contents.
Only authenticated users may call this resource.
Example request representations:
# Hello World!
Example response representations:
{
"html" : "<h1>Hello World!</h1>"
}
The rendered markdown.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The markdown was invalid.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions preview rendered markdown.
This is a paged API.
Retrieve a page of recently accessed repositories for the currently authenticated user.
parameter | value | description |
---|---|---|
permission |
(optional) if specified, it must be a valid repository permission level name and will limit
the resulting repository list to ones that the requesting user has the specified permission
level to. If not specified, the default |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of recently accessed repositories.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The permission level is unknown or not related to repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request is unauthenticated.
This is a paged API.
Retrieve a page of projects.
Only projects for which the authenticated user has the PROJECT_VIEW permission will be returned.
parameter | value | description |
---|---|---|
name |
||
permission |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of projects.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The permission level is unknown or not related to projects.
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.
Example request representations:
{
"key" : "PRJ",
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"avatar" : "data:image/png;base64,<base64-encoded-image-data>"
}
Example response representations:
{
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
}
The newly created project.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The project was not created due to a validation error.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to create a project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The project key or name is already in use.
Retrieve the project matching the supplied projectKey.
The authenticated user must have PROJECT_VIEW permission for the specified project to call this resource.
Example response representations:
{
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
}
The project matching the supplied projectKey.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
Delete the project matching the supplied projectKey.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
Example response representations:
The project matching the supplied projectKey was deleted.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to delete the project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The project can not be deleted as it contains repositories.
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.
Example request representations:
{
"key" : "PRJ",
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"avatar" : "data:image/png;base64,<base64-encoded-image-data>"
}
Example response representations:
{
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
}
The updated project. The project's key was not updated.
{
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
}
The updated project. The project's key was updated.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The project was not updated due to a validation error.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update the project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
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.
parameter | value | description |
---|---|---|
s |
Default: 0 |
The desired size of the image. The server will return an image as close as possible to the specified size. |
Example response representations:
The avatar of the project matching the supplied projectKey.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
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.
An example curl request to upload an image name 'avatar.png' would be:
curl -X POST -u username:password 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.
Example response representations:
The avatar was uploaded successfully.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update the project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
Promote or demote a user's permission level for the specified project. Available project permissions are:
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.
parameter | value | description |
---|---|---|
name |
the names of the users |
|
permission |
the permission to grant |
Example response representations:
The requested permission was granted.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project or user does not exist.
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.
parameter | value | description |
---|---|---|
name |
the name of the user |
Example response representations:
All project permissions were revoked from the user for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator of the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project or group does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
This is a paged API.
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.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"permission" : "ADMIN"
} ],
"start" : 0,
"filter" : null
}
A page of users and their highest permissions for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
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.
parameter | value | description |
---|---|---|
name |
the name of the group |
Example response representations:
All project permissions were revoked from the group for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator of the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project or group does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
This is a paged API.
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.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"group" : {
"name" : "group_a"
},
"permission" : "ADMIN"
} ],
"start" : 0,
"filter" : null
}
A page of groups and their highest permissions for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
Promote or demote a group's permission level for the specified project. Available project permissions are:
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 their own permission level would be reduced as a result.
parameter | value | description |
---|---|---|
permission |
the permission to grant |
|
name |
the names of the groups |
Example response representations:
The requested permission was granted.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project or group does not exist.
parameter | value | description |
---|---|---|
permission |
the permission to grant |
Check whether the specified permission is the default permission (granted to all users) for a project. Available project permissions are:
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
Example response representations:
{
"permitted" : true
}
A simple entity indicating whether the specified permission is the default permission for this project.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator of the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
Grant or revoke a project permission to all users, i.e. set the default permission. Available project permissions are:
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
parameter | value | description |
---|---|---|
allow |
true to grant the specified permission to all users, or false to revoke it |
Example response representations:
{
"permitted" : true
}
A simple entity indicating whether the specified permission is the default permission for this project.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator of the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
This is a paged API.
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 global permission to call this resource.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of groups that have not been granted any permissions for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
This is a paged API.
Retrieve a page of 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.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of users that have not been granted any permissions for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a project administrator for the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
parameter | value | description |
---|---|---|
projectKey |
the parent project key |
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve repositories from the project corresponding to the supplied projectKey.
The authenticated user must have REPO_READ permission for the specified project to call this resource.
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
The repositories matching the supplied projectKey.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to see the specified project.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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 PROJECT_ADMIN permission for the context project to call this resource.
Example request representations:
{
"name" : "My repo",
"scmId" : "git",
"forkable" : true
}
Example response representations:
{
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
}
The newly created repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository was not created due to a validation error.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to create a repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
A repository with same name already exists.
parameter | value | description |
---|---|---|
projectKey |
the parent project key |
|
repositorySlug |
the repository slug |
|
projectKey |
the parent project key |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example response representations:
{
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
}
The repository which matches the supplied projectKey and repositorySlug.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to see the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Update the name of a repository.
The repository's slug is derived from its name. If the name changes the slug may also change.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
Example request representations:
{
"name" : "My repo"
}
Example response representations:
{
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
}
The updated repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository was not updated due to a validation error.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update a repository
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
A repository with same name as the target already exists
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Schedule the repository matching the supplied projectKey and repositorySlug to
be deleted. If the request repository is not present
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
Example response representations:
{
"context" : null,
"message" : "Repository scheduled for deletion.",
"exceptionName" : null
}
The repository has been scheduled for deletion.
No repository matching the supplied projectKey and repositorySlug was found.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to delete the repository.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Create a new repository forked from an existing repository.
Example request representations:
{
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
Example response representations:
{
"slug" : "my-repo",
"id" : 2,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"origin" : {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
},
"project" : {
"key" : "~JDOE",
"id" : 2,
"name" : "John Doe",
"type" : "PERSONAL",
"isPersonal" : true,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"cloneUrl" : "https://<baseURL>/scm/JDOE/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
}
The newly created fork.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
A validation error prevented the fork from being created. Possible validation errors include: The name or slug for the fork collides with another repository in the target project; an SCM type was specified in the JSON body; a project was specified in the JSON body without a "key" property.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to create a fork.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist, or, if a target project was specified, the target project does not exist.
parameter | value | description |
---|---|---|
projectKey |
the parent project key |
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve repositories which have been forked from this one. Unlike {@link #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.
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"slug" : "my-repo",
"id" : 2,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"origin" : {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
},
"project" : {
"key" : "~JDOE",
"id" : 2,
"name" : "John Doe",
"type" : "PERSONAL",
"isPersonal" : true,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"cloneUrl" : "https://<baseURL>/scm/JDOE/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of repositories related to the request repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to see the request repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request repository does not exist.
parameter | value | description |
---|---|---|
projectKey |
the parent project key |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example response representations:
{
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
}
The newly created repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository was not created due to a validation error.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to create a repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
parameter | value | description |
---|---|---|
projectKey |
the parent project key |
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve repositories which are related to this one. Related repositories are from the same
{@link Repository#getHierarchyId() hierarchy} as this repository.
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"slug" : "my-repo",
"id" : 2,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"origin" : {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
},
"project" : {
"key" : "~JDOE",
"id" : 2,
"name" : "John Doe",
"type" : "PERSONAL",
"isPersonal" : true,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"cloneUrl" : "https://<baseURL>/scm/JDOE/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of repositories related to the request repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to see the request repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request repository does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve the branches matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
parameter | value | description |
---|---|---|
filterText |
the text to match on |
|
orderBy |
ordering of refs either ALPHABETICAL (by name) or MODIFICATION (last updated) |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"id" : "refs/heads/master",
"displayId" : "master",
"latestChangeset" : "8d51122def5632836d1cb1026e879069e10a1e13",
"isDefault" : true
} ],
"start" : 0,
"filter" : null
}
The branches matching the supplied filterText.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to read the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Get the default branch of the repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
Example response representations:
{
"id" : "refs/heads/master",
"displayId" : "master",
"latestChangeset" : "8d51122def5632836d1cb1026e879069e10a1e13",
"isDefault" : true
}
The branches matching the supplied filterText.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to read the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist or the repository has no default branch configured.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Update the default branch of a repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
Example request representations:
{
"id" : "refs/heads/master"
}
Example response representations:
The operation was successful
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update the repository
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a page of 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.
parameter | value | description |
---|---|---|
at |
Default: |
the changeset id or ref to retrieve the content for. |
type |
Default: false |
if true only the type will be returned for the file path instead of the contents. |
blame |
if present the blame will be returned for the file as well. |
|
noContent |
if present and used with blame only the blame is retrieved instead of the contents. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"start" : 0,
"filter" : null,
"lines" : [ {
"text" : "print('hello world')"
} ]
}
A page of contents from a file.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The path or until parameters were not supplied.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository does not exist.
parameter | value | description |
---|---|---|
path |
Default: |
the file path to retrieve content from |
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a page of 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.
parameter | value | description |
---|---|---|
at |
Default: |
the changeset id or ref to retrieve the content for. |
type |
Default: false |
if true only the type will be returned for the file path instead of the contents. |
blame |
if present the blame will be returned for the file as well. |
|
noContent |
if present and used with blame only the blame is retrieved instead of the contents. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"start" : 0,
"filter" : null,
"lines" : [ {
"text" : "print('hello world')"
} ]
}
A page of contents from a file.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The path or until parameters were not supplied.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a page of changes made in a specified commit.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
parameter | value | description |
---|---|---|
since |
the changeset to which |
|
until |
the changeset to retrieve file changes for. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"contentId" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"path" : {
"components" : [ "new", "path", "to", "file.txt" ],
"parent" : "new/path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "new/path/to/file.txt"
},
"executable" : false,
"percentUnchanged" : 98,
"type" : "MOVE",
"nodeType" : "FILE",
"srcPath" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"srcExecutable" : false,
"link" : {
"url" : "http://link/to/restchange",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of changes
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The until parameter was not supplied
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository or the since or until parameters supplied does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a page of changesets from a given starting commit or between two commits. The commits may be identified
by branch or tag name or by hash. A path may be supplied to restrict the returned changesets to only those which
affect that path.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
parameter | value | description |
---|---|---|
path |
an optional path to filter changesets by |
|
since |
the changeset id or ref (exclusively) to restrieve changesets after |
|
until |
the changeset id or ref (inclusively) to retrieve changesets before |
|
withCounts |
Default: false |
optionally include the total number of changesets and total number of unique authors |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"id" : "def0123abcdef4567abcdef8987abcdef6543abc",
"displayId" : "def0123",
"author" : {
"name" : "charlie",
"emailAddress" : "charlie@example.com"
},
"authorTimestamp" : 1374798803452,
"message" : "More work on feature 1",
"parents" : [ {
"id" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"displayId" : "abcdef0"
} ]
} ],
"start" : 0,
"filter" : null,
"authorCount" : 1,
"totalCount" : 1
}
A page of changesets.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the supplied changeset ids or refs was invalid.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository does not exist.
parameter | value | description |
---|---|---|
changesetId |
the changeset id or ref (inclusively) to retrieve changesets before. |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a changeset for a given changeset id, tag or branch.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
parameter | value | description |
---|---|---|
path |
an optional path to filter changesets by. If supplied the details returned may not be for the specified commit. Instead, starting from the specified commit, they will be the details for the first commit affecting the specified path. |
Example response representations:
{
"id" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"displayId" : "abcdef0",
"author" : {
"name" : "charlie",
"emailAddress" : "charlie@example.com"
},
"authorTimestamp" : 1374798803452,
"message" : "WIP on feature 1",
"parents" : [ {
"id" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"displayId" : "abcdef0"
} ]
}
A changeset.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The supplied changeset ids or ref was invalid.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository does not exist.
parameter | value | description |
---|---|---|
path |
the path to the file which should be diffed. |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve the diff for a specified file path between two provided revisions.
Note: This resource is currently not paged. The server will internally apply a hard cap
to the streamed lines, and it is not possible to request subsequent pages if that cap is exceeded. In the event
that the cap is reached, the diff will be cut short and one or more truncated
flags will be set to
true
on the segments, hunks and diffs substructures in the returned JSON response.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
parameter | value | description |
---|---|---|
since |
the base revision to diff from. If omitted the parent revision of the until revision is used. |
|
until |
the target revision to diff to. |
|
srcPath |
the source path for the file, if it was copied, moved or renamed. |
|
whitespace |
optional whitespace flag which can be set to |
Example response representations:
{
"diffs" : [ {
"source" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"destination" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"hunks" : [ {
"sourceLine" : 1,
"sourceSpan" : 1,
"destinationLine" : 1,
"destinationSpan" : 2,
"segments" : [ {
"type" : "REMOVED",
"lines" : [ {
"destination" : 1,
"source" : 1,
"line" : "import sys",
"truncated" : false
} ],
"truncated" : false
}, {
"type" : "ADDED",
"lines" : [ {
"destination" : 1,
"source" : 2,
"line" : "import re",
"truncated" : false
}, {
"destination" : 2,
"source" : 3,
"line" : "import os",
"truncated" : false
} ],
"truncated" : false
} ],
"truncated" : false
} ],
"truncated" : false
} ]
}
A diff of a file path.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The path or until parameters were not supplied.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
at |
Default: |
the changeset id or ref (e.g. a branch or tag) to list the files at. If not specified the default branch will be used instead. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ "path/to/file.txt" ],
"start" : 0,
"filter" : null
}
A page of files.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The path supplied is not a directory at the supplied changeset.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The path supplied does not exist at the supplied changeset.
parameter | value | description |
---|---|---|
path |
Default: |
the directory to list files for. |
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
at |
the changeset id or ref (e.g. a branch or tag) to list the files at. If not specified the default branch will be used instead. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ "path/to/file.txt" ],
"start" : 0,
"filter" : null
}
A page of files.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The path supplied is not a directory at the supplied changeset.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The path supplied does not exist at the supplied changeset.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Promote or demote a group'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 demote a group's permission level if their own permission level would be reduced as a result.
parameter | value | description |
---|---|---|
permission |
the permission to grant |
|
name |
the names of the groups |
Example response representations:
The requested permission was granted.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or group does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
name |
the name of the group |
Example response representations:
All repository permissions were revoked from the group for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator of the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or group does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"group" : {
"name" : "group_a"
},
"permission" : "ADMIN"
} ],
"start" : 0,
"filter" : null
}
A page of groups and their highest permissions for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a repository administrator for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
name |
the names of the users |
|
permission |
the permission to grant |
Example response representations:
The requested permission was granted.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the specified permission does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or user does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
name |
the name of the user |
Example response representations:
All repository permissions were revoked from the user for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not an administrator of the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or group does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The action was disallowed as it would reduce the currently authenticated user's permission level.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"permission" : "ADMIN"
} ],
"start" : 0,
"filter" : null
}
A page of users and their highest permissions for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a repository administrator for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of groups that have not been granted any permissions for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a repository administrator for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a page of 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.
parameter | value | description |
---|---|---|
filter |
if specified only group names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "group-a",
"deletable" : true
} ],
"start" : 0,
"filter" : null
}
A page of users that have not been granted any permissions for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user is not a repository administrator for the specified repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Create a new pull request between two branches. The branches may be in the same repository, or different ones.
When using different repositories, they must still be in the same {@link Repository#getHierarchyId() hierarchy}.
Example request representations:
{
"title" : "Talking Nerdy",
"description" : "It’s a kludge, but put the tuple from the database in the cache.",
"state" : "OPEN",
"fromRef" : {
"id" : "refs/heads/feature-ABC-123",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"toRef" : {
"id" : "refs/heads/master",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"reviewers" : [ {
"user" : {
"name" : "charlie"
}
} ]
}
Example response representations:
{
"id" : 101,
"version" : 1,
"title" : "Talking Nerdy",
"description" : "It’s a kludge, but put the tuple from the database in the cache.",
"state" : "OPEN",
"createdDate" : 1359075920,
"updatedDate" : 1359075920,
"fromRef" : {
"id" : "refs/heads/feature",
"displayId" : "feature-ABC-123",
"latestChangeset" : "babecafebabecafebabecafebabecafebabecafe",
"repository" : {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
}
},
"toRef" : {
"id" : "refs/heads/master",
"displayId" : "master",
"latestChangeset" : "cafebabecafebabecafebabecafebabecafebabe",
"repository" : {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
}
},
"author" : {
"user" : {
"name" : "alice",
"emailAddress" : "alice@example.com",
"id" : 92903040,
"displayName" : "Alice",
"active" : true,
"slug" : "alice"
},
"role" : "PARTICIPANT",
"approved" : false
},
"reviewers" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : false
} ],
"participants" : [ ],
"link" : {
"url" : "http://link/to/pullrequest",
"rel" : "self"
}
}
The newly created pull request.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The pull request entity supplied in the request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to create a pull request between the two specified repositories.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the specified repositories or branches does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the following error cases occurred (check the error message for more details):
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
direction |
Default: incoming |
(optional, defaults to INCOMING) the direction relative to the specified repository. Either INCOMING or OUTGOING. |
at |
(optional) a specific branch to find pull requests to or from. |
|
state |
(optional, defaults to OPEN) only pull requests in the specified state will be returned. Either OPEN, DECLINED or MERGED. |
|
order |
(optional) the order to return pull requests in, either OLDEST (as in: "oldest first") or NEWEST. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"id" : 101,
"version" : 1,
"title" : "Talking Nerdy",
"description" : "It’s a kludge, but put the tuple from the database in the cache.",
"state" : "OPEN",
"createdDate" : 1359075920,
"updatedDate" : 1359085920,
"fromRef" : {
"id" : "refs/heads/feature-ABC-123",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"toRef" : {
"id" : "refs/heads/master",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"author" : {
"user" : {
"name" : "tom",
"emailAddress" : "tom@example.com",
"id" : 115026,
"displayName" : "Tom",
"active" : true,
"slug" : "tom"
},
"role" : "AUTHOR",
"approved" : true
},
"reviewers" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : true
} ],
"participants" : [ {
"user" : {
"name" : "harry",
"emailAddress" : "harry@example.com",
"id" : 99049120,
"displayName" : "Harry",
"active" : true,
"slug" : "harry"
},
"role" : "PARTICIPANT",
"approved" : true
}, {
"user" : {
"name" : "dick",
"emailAddress" : "dick@example.com",
"id" : 3083181,
"displayName" : "Dick",
"active" : true,
"slug" : "dick"
},
"role" : "PARTICIPANT",
"approved" : false
} ],
"link" : {
"url" : "http://link/to/pullrequest",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of pull requests that match the search criteria.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
Example response representations:
{
"id" : 101,
"version" : 1,
"title" : "Talking Nerdy",
"description" : "It’s a kludge, but put the tuple from the database in the cache.",
"state" : "OPEN",
"createdDate" : 1359075920,
"updatedDate" : 1359085920,
"fromRef" : {
"id" : "refs/heads/feature-ABC-123",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"toRef" : {
"id" : "refs/heads/master",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"author" : {
"user" : {
"name" : "tom",
"emailAddress" : "tom@example.com",
"id" : 115026,
"displayName" : "Tom",
"active" : true,
"slug" : "tom"
},
"role" : "AUTHOR",
"approved" : true
},
"reviewers" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : true
} ],
"participants" : [ {
"user" : {
"name" : "harry",
"emailAddress" : "harry@example.com",
"id" : 99049120,
"displayName" : "Harry",
"active" : true,
"slug" : "harry"
},
"role" : "PARTICIPANT",
"approved" : true
}, {
"user" : {
"name" : "dick",
"emailAddress" : "dick@example.com",
"id" : 3083181,
"displayName" : "Dick",
"active" : true,
"slug" : "dick"
},
"role" : "PARTICIPANT",
"approved" : false
} ],
"link" : {
"url" : "http://link/to/pullrequest",
"rel" : "self"
}
}
The specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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:
Example request representations:
{
"id" : 101,
"version" : 2,
"title" : "Talking Nerdy",
"description" : "It’s a hack, but force AO to eagerly initialize to avoid deadlocks.",
"reviewers" : [ {
"user" : {
"name" : "charlie"
}
} ]
}
Example response representations:
{
"id" : 101,
"version" : 1,
"title" : "Talking Nerdy",
"description" : "It’s a kludge, but put the tuple from the database in the cache.",
"state" : "OPEN",
"createdDate" : 1359075920,
"updatedDate" : 1359085920,
"fromRef" : {
"id" : "refs/heads/feature-ABC-123",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"toRef" : {
"id" : "refs/heads/master",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"author" : {
"user" : {
"name" : "tom",
"emailAddress" : "tom@example.com",
"id" : 115026,
"displayName" : "Tom",
"active" : true,
"slug" : "tom"
},
"role" : "AUTHOR",
"approved" : true
},
"reviewers" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : true
} ],
"participants" : [ {
"user" : {
"name" : "harry",
"emailAddress" : "harry@example.com",
"id" : 99049120,
"displayName" : "Harry",
"active" : true,
"slug" : "harry"
},
"role" : "PARTICIPANT",
"approved" : true
}, {
"user" : {
"name" : "dick",
"emailAddress" : "dick@example.com",
"id" : 3083181,
"displayName" : "Dick",
"active" : true,
"slug" : "dick"
},
"role" : "PARTICIPANT",
"approved" : false
} ],
"link" : {
"url" : "http://link/to/pullrequest",
"rel" : "self"
}
}
The updated pull request.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the following error cases occurred (check the error message for more details):
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update the specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the specified repositories or branches does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the following error cases occurred (check the error message for more details):
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
fromId |
(optional) the id of the activity item to use as the first item in the returned page |
|
fromType |
(required if fromId is present) the type of the activity item specified by fromId (either COMMENT or ACTIVITY) |
Example response representations:
{
"size" : 3,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"id" : 101,
"createdDate" : 1359065920,
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"action" : "COMMENTED",
"commentAction" : "ADDED",
"comment" : {
"id" : 1,
"version" : 1,
"text" : "A measured reply.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ {
"id" : 1,
"version" : 1,
"text" : "An insightful comment.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
} ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
}
}, {
"id" : 101,
"createdDate" : 1359065920,
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"action" : "RESCOPED",
"fromHash" : "abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde",
"previousFromHash" : "bcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdea",
"previousToHash" : "cdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeab",
"toHash" : "ddeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabc",
"added" : {
"changesets" : [ {
"id" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"displayId" : "abcdef0",
"author" : {
"name" : "charlie",
"emailAddress" : "charlie@example.com"
},
"authorTimestamp" : 1374798803452,
"message" : "WIP on feature 1",
"parents" : [ {
"id" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"displayId" : "abcdef0"
} ]
} ],
"total" : 1
},
"removed" : {
"changesets" : [ {
"id" : "def0123abcdef4567abcdef8987abcdef6543abc",
"displayId" : "def0123",
"author" : {
"name" : "charlie",
"emailAddress" : "charlie@example.com"
},
"authorTimestamp" : 1374798803452,
"message" : "More work on feature 1",
"parents" : [ {
"id" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"displayId" : "abcdef0"
} ]
} ],
"total" : 1
}
}, {
"id" : 101,
"createdDate" : 1359085920,
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"action" : "MERGED"
} ],
"start" : 0,
"filter" : null
}
A page of activity relating to the specified pull request.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
parameter | value | description |
---|---|---|
pullRequestId |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Decline a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
parameter | value | description |
---|---|---|
version |
Default: -1 |
the current version of the pull request. If the server's version is newer than the specified version the operation will fail. To determine the current version of the pull request it should be fetched from the server prior to this operation. Look for the 'version' attribute in the returned JSON structure. |
Example response representations:
The pull request was declined.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The pull request is not OPEN or has been updated since the version specified by the request.
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example response representations:
{
"canMerge" : false,
"conflicted" : false,
"vetoes" : [ {
"summaryMessage" : "You may not merge after 6pm on a Friday.",
"detailedMessage" : "It is likely that your Blood Alcohol Content (BAC) exceeds the threshold for making sensible decisions regarding pull requests. Please try again on Monday."
} ]
}
The merge status of a the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified pull request is not open.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
version |
Default: -1 |
the current version of the pull request. If the server's version is newer than the specified version the operation will fail. To determine the current version of the pull request it should be fetched from the server prior to this operation. Look for the 'version' attribute in the returned JSON structure. |
Example response representations:
{
"id" : 101,
"version" : 1,
"title" : "Talking Nerdy",
"description" : "It’s a kludge, but put the tuple from the database in the cache.",
"state" : "MERGED",
"createdDate" : 1359075920,
"updatedDate" : 1359115920,
"fromRef" : {
"id" : "refs/heads/feature-ABC-123",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"toRef" : {
"id" : "refs/heads/master",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"author" : {
"user" : {
"name" : "tom",
"emailAddress" : "tom@example.com",
"id" : 115026,
"displayName" : "Tom",
"active" : true,
"slug" : "tom"
},
"role" : "AUTHOR",
"approved" : true
},
"reviewers" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : true
} ],
"participants" : [ {
"user" : {
"name" : "harry",
"emailAddress" : "harry@example.com",
"id" : 99049120,
"displayName" : "Harry",
"active" : true,
"slug" : "harry"
},
"role" : "PARTICIPANT",
"approved" : true
}, {
"user" : {
"name" : "dick",
"emailAddress" : "dick@example.com",
"id" : 3083181,
"displayName" : "Dick",
"active" : true,
"slug" : "dick"
},
"role" : "PARTICIPANT",
"approved" : true
} ],
"link" : {
"url" : "http://link/to/pullrequest",
"rel" : "self"
}
}
The merged pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to merge the specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the following error cases occurred (check the error message for more details):
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
version |
Default: -1 |
the current version of the pull request. If the server's version is newer than the specified version the operation will fail. To determine the current version of the pull request it should be fetched from the server prior to this operation. Look for the 'version' attribute in the returned JSON structure. |
Example response representations:
{
"id" : 101,
"version" : 1,
"title" : "Talking Nerdy",
"description" : "It’s a kludge, but put the tuple from the database in the cache.",
"state" : "OPEN",
"createdDate" : 1359075920,
"updatedDate" : 1359085920,
"fromRef" : {
"id" : "refs/heads/feature-ABC-123",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"toRef" : {
"id" : "refs/heads/master",
"repository" : {
"slug" : "my-repo",
"name" : null,
"project" : {
"key" : "PRJ"
}
}
},
"author" : {
"user" : {
"name" : "tom",
"emailAddress" : "tom@example.com",
"id" : 115026,
"displayName" : "Tom",
"active" : true,
"slug" : "tom"
},
"role" : "AUTHOR",
"approved" : true
},
"reviewers" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : true
} ],
"participants" : [ {
"user" : {
"name" : "harry",
"emailAddress" : "harry@example.com",
"id" : 99049120,
"displayName" : "Harry",
"active" : true,
"slug" : "harry"
},
"role" : "PARTICIPANT",
"approved" : true
}, {
"user" : {
"name" : "dick",
"emailAddress" : "dick@example.com",
"id" : 3083181,
"displayName" : "Dick",
"active" : true,
"slug" : "dick"
},
"role" : "PARTICIPANT",
"approved" : false
} ],
"link" : {
"url" : "http://link/to/pullrequest",
"rel" : "self"
}
}
The merged pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to reopen the specified pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
One of the following error cases occurred (check the error message for more details):
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example response representations:
{
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : true
}
Details of the new participant
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The pull request is not open.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example response representations:
{
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : false
}
Details of the updated participant
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist or the current user is not a participant on the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The pull request is not open.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Gets changes for the specified PullRequest.
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"contentId" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"path" : {
"components" : [ "new", "path", "to", "file.txt" ],
"parent" : "new/path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "new/path/to/file.txt"
},
"executable" : false,
"percentUnchanged" : 98,
"type" : "MOVE",
"nodeType" : "FILE",
"srcPath" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"srcExecutable" : false,
"link" : {
"url" : "http://link/to/restchange",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of Changes from the supplied pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository or pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository or pull request does not exist.
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Add a new comment.
{ "text": "An insightful general comment on a pull request." }Reply to a comment:
{ "text": "A measured reply.", "parent": { "id": 1 } }General file comment:
{ "text": "An insightful general comment on a file.", "anchor": { "path": "path/to/file", "srcPath": "path/to/file" } }File line comment:
{ "text": "A pithy comment on a particular line within a file.", "anchor": { "line": 1, "lineType": "CONTEXT", "path": "path/to/file", "srcPath": "path/to/file" } }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). 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:
Example request representations:
{
"text" : "An insightful comment.",
"parent" : {
"id" : 1
},
"anchor" : {
"line" : 1,
"lineType" : "CONTEXT",
"path" : "path/to/file",
"srcPath" : "path/to/file"
}
}
Example response representations:
{
"id" : 1,
"version" : 1,
"text" : "A measured reply.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ {
"id" : 1,
"version" : 1,
"text" : "An insightful comment.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
} ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
}
The newly created comment.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The comment was not created due to a validation error.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request, create a comment or watch the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Unable to find the supplied project, repository, pull request or parent comment
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
|
pullRequestId |
the id of the pull request within the repository |
|
commentId |
the id of the comment to update |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example response representations:
{
"id" : 1,
"version" : 1,
"text" : "A measured reply.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ {
"id" : 1,
"version" : 1,
"text" : "An insightful comment.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
} ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
}
The requested comment.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the comment
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Unable to find the supplied project, repository, pull request or comment
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
version |
Default: -1 |
The expected version of the comment. This must match the server's version of the comment or the delete will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the delete. Look for the 'version' attribute in the returned JSON structure. |
Example response representations:
The operation was successful
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to delete the comment.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Unable to find the supplied project, repository or pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The comment has replies or the version supplied does not match the current version.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Update the text of a comment. Only the user who created a comment may update it.
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 this pull request targets to call this resource.
Example request representations:
{
"version" : 0,
"text" : "A pithy comment."
}
Example response representations:
{
"id" : 1,
"version" : 1,
"text" : "A measured reply.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ {
"id" : 1,
"version" : 1,
"text" : "An insightful comment.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
} ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
}
The newly updated comment.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The comment was not updated due to a validation error.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request, update a comment or watch the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Unable to find the supplied project, repository, pull request or comment
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The comment version supplied does not match the current version.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve changesets 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.
parameter | value | description |
---|---|---|
withCounts |
if set to true, the service will add "authorCount" and "totalCount" at the end of the page. "authorCount" is the number of different authors and "totalCount" is the total number of changesets. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"id" : "def0123abcdef4567abcdef8987abcdef6543abc",
"displayId" : "def0123",
"author" : {
"name" : "charlie",
"emailAddress" : "charlie@example.com"
},
"authorTimestamp" : 1374798803452,
"message" : "More work on feature 1",
"parents" : [ {
"id" : "abcdef0123abcdef4567abcdef8987abcdef6543",
"displayId" : "abcdef0"
} ]
} ],
"start" : 0,
"filter" : null,
"authorCount" : 1,
"totalCount" : 1
}
a page of changesets from the supplied pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository or pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository or pull request does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Streams a diff for the specified path
within a pull request. If the file has been copied, moved or
renamed, the srcPath
must also be specified to produce the correct diff.
parameter | value | description |
---|---|---|
srcPath |
the previous path to the file, if the file has been copied, moved or renamed |
|
whitespace |
optional whitespace flag which can be set to |
Example response representations:
{
"diffs" : [ {
"source" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"destination" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"hunks" : [ {
"sourceLine" : 1,
"sourceSpan" : 1,
"destinationLine" : 1,
"destinationSpan" : 2,
"segments" : [ {
"type" : "REMOVED",
"lines" : [ {
"destination" : 1,
"source" : 1,
"line" : "import sys",
"truncated" : false
} ],
"truncated" : false
}, {
"type" : "ADDED",
"lines" : [ {
"destination" : 1,
"source" : 2,
"line" : "import re",
"truncated" : false,
"conflictMarker" : "OURS",
"commentIds" : [ 1 ]
}, {
"destination" : 2,
"source" : 3,
"line" : "import os",
"truncated" : false
} ],
"truncated" : false
} ],
"truncated" : false
} ],
"lineComments" : [ {
"id" : 1,
"version" : 1,
"text" : "An insightful comment.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
} ],
"truncated" : false
} ]
}
a page of differences from a pull request, for the specified path.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
If no path was specified or the request was otherwise malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository or pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository or pull request does not exist.
parameter | value | description |
---|---|---|
path |
the path to the file which should be diffed |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Streams a diff for the specified path
within a pull request. If the file has been copied, moved or
renamed, the srcPath
must also be specified to produce the correct diff.
parameter | value | description |
---|---|---|
srcPath |
the previous path to the file, if the file has been copied, moved or renamed |
|
whitespace |
optional whitespace flag which can be set to |
Example response representations:
{
"diffs" : [ {
"source" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"destination" : {
"components" : [ "path", "to", "file.txt" ],
"parent" : "path/to",
"name" : "file.txt",
"extension" : "txt",
"toString" : "path/to/file.txt"
},
"hunks" : [ {
"sourceLine" : 1,
"sourceSpan" : 1,
"destinationLine" : 1,
"destinationSpan" : 2,
"segments" : [ {
"type" : "REMOVED",
"lines" : [ {
"destination" : 1,
"source" : 1,
"line" : "import sys",
"truncated" : false
} ],
"truncated" : false
}, {
"type" : "ADDED",
"lines" : [ {
"destination" : 1,
"source" : 2,
"line" : "import re",
"truncated" : false,
"conflictMarker" : "OURS",
"commentIds" : [ 1 ]
}, {
"destination" : 2,
"source" : 3,
"line" : "import os",
"truncated" : false
} ],
"truncated" : false
} ],
"truncated" : false
} ],
"lineComments" : [ {
"id" : 1,
"version" : 1,
"text" : "An insightful comment.",
"author" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"createdDate" : 1374798803283,
"updatedDate" : 1374798803283,
"comments" : [ ],
"permittedOperations" : {
"editable" : true,
"deletable" : true
}
} ],
"truncated" : false
} ]
}
a page of differences from a pull request, for the specified path.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
If no path was specified or the request was otherwise malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the repository or pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The repository or pull request does not exist.
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : true
} ],
"start" : 0,
"filter" : null
}
Details of the participants in this pull request
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
Example request representations:
{
"user" : {
"name" : "charlie"
},
"role" : "REVIEWER"
}
Example response representations:
{
"user" : {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
},
"role" : "REVIEWER",
"approved" : false
}
The created or updated participant.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request does not have the username and role, or is attempting an invalid assignment
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
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.
parameter | value | description |
---|---|---|
username |
the participant's user name |
Example response representations:
The update completed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request does not have the username
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to update the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
parameter | value | description |
---|---|---|
pullRequestId |
the id of the pull request within the repository |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Make the authenticated user watch the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
Example response representations:
The user is now watching the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Make the authenticated user stop watching the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
Example response representations:
The user is no longer watching the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the pull request.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository or pull request does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a page of repository hooks for this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
parameter | value | description |
---|---|---|
type |
Default: |
the optional type to filter by. Valid values are |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"details" : {
"key" : "com.atlassian.stash.plugin.example:example-repository-hook",
"name" : "Example repository hook",
"type" : "PRE_RECEIVE",
"description" : "An example description for an example hook.",
"version" : "1.2.4",
"configFormKey" : null
},
"enabled" : true,
"configured" : true
} ],
"start" : 0,
"filter" : null
}
returns a page of repository hooks with their associated enabled state.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to retrieve the hooks.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project or repository does not exist.
parameter | value | description |
---|---|---|
hookKey |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve a repository hook for this repositories.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
Example response representations:
{
"details" : {
"key" : "com.atlassian.stash.plugin.example:example-repository-hook",
"name" : "Example repository hook",
"type" : "PRE_RECEIVE",
"description" : "An example description for an example hook.",
"version" : "1.2.4",
"configFormKey" : null
},
"enabled" : true,
"configured" : true
}
returns the repository hooks with their associated enabled state for the supplied hookKey.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to retrieve the hook.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project, repository or hook does not exist.
parameter | value | description |
---|---|---|
hookKey |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Disable a repository hook for this repositories.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
Example response representations:
{
"details" : {
"key" : "com.atlassian.stash.plugin.example:example-repository-hook",
"name" : "Example repository hook",
"type" : "PRE_RECEIVE",
"description" : "An example description for an example hook.",
"version" : "1.2.4",
"configFormKey" : null
},
"enabled" : true,
"configured" : true
}
returns the repository hooks with their associated enabled state for the supplied hookKey.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to disable the hook.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project, repository or hook does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Enable a repository hook for this repositories and optionally applying new configuration.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
parameter | value | description |
---|---|---|
Content-Length |
Default: 0 |
Example response representations:
{
"details" : {
"key" : "com.atlassian.stash.plugin.example:example-repository-hook",
"name" : "Example repository hook",
"type" : "PRE_RECEIVE",
"description" : "An example description for an example hook.",
"version" : "1.2.4",
"configFormKey" : null
},
"enabled" : true,
"configured" : true
}
returns the repository hooks with their associated enabled state for the supplied hookKey.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The settings specified are invalid.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to enable the hook.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project, repository or hook does not exist.
parameter | value | description |
---|---|---|
hookKey |
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve the settings for a repository hook for this repositories.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
Example response representations:
{
"details" : {
"key" : "com.atlassian.stash.plugin.example:example-repository-hook",
"name" : "Example repository hook",
"type" : "PRE_RECEIVE",
"description" : "An example description for an example hook.",
"version" : "1.2.4",
"configFormKey" : null
},
"enabled" : true,
"configured" : true
}
The settings for the hook.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to retrieve the hook settings.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project, repository or hook does not exist.
This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Modify the settings for a repository hook for this repositories.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
Example request representations:
Example response representations:
{
"details" : {
"key" : "com.atlassian.stash.plugin.example:example-repository-hook",
"name" : "Example repository hook",
"type" : "PRE_RECEIVE",
"description" : "An example description for an example hook.",
"version" : "1.2.4",
"configFormKey" : null
},
"enabled" : true,
"configured" : true
}
The settings for the hook.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The settings specified are invalid.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to modify the hook settings.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified project, repository or hook does not exist.
This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects.
Retrieve the tags matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
parameter | value | description |
---|---|---|
filterText |
the text to match on |
|
orderBy |
ordering of refs either ALPHABETICAL (by name) or MODIFICATION (last updated) |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"id" : "release-2.0.0",
"displayId" : "refs/tags/release-2.0.0",
"latestChangeset" : "8d351a10fb428c0c1239530256e21cf24f136e73",
"hash" : "8d51122def5632836d1cb1026e879069e10a1e13"
} ],
"start" : 0,
"filter" : null
}
The tags matching the supplied filterText.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to read the repository.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified repository does not exist.
REST resource for searching through repositories
This is a paged API.
parameter | value | description |
---|---|---|
name |
(optional) if specified, this will limit the resulting repository list to ones whose name
matches this parameter's value. The match will be done case-insensitive and any leading
and/or trailing whitespace characters on the |
|
projectname |
(optional) if specified, this will limit the resulting repository list to ones whose project's
name matches this parameter's value. The match will be done case-insensitive and any leading
and/or trailing whitespace characters on the |
|
permission |
(optional) if specified, it must be a valid repository permission level name and will limit the resulting repository list to ones that the requesting user has the specified permission level to. If not specified, the default implicit 'read' permission level will be assumed. The currently supported explicit permission values are REPO_READ, REPO_WRITE and REPO_ADMIN. |
|
visibility |
(optional) if specified, this will limit the resulting repository list based on the repositories visibility. Valid values are public or private. |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"slug" : "my-repo",
"id" : 1,
"name" : "My repo",
"scmId" : "git",
"state" : "AVAILABLE",
"statusMessage" : "Available",
"forkable" : true,
"project" : {
"key" : "PRJ",
"id" : 1,
"name" : "My Cool Project",
"description" : "The description for my cool project.",
"public" : true,
"type" : "NORMAL",
"isPersonal" : false,
"link" : {
"url" : "http://link/to/project",
"rel" : "self"
}
},
"public" : true,
"cloneUrl" : "https://<baseURL>/scm/PRJ/my-repo.git",
"link" : {
"url" : "http://link/to/repository",
"rel" : "self"
}
} ],
"start" : 0,
"filter" : null
}
A page of repositories.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The visibility
parameter contains an invalid value
This is a paged API.
Retrieve a page of users.
Only authenticated users may call this resource.
parameter | value | description |
---|---|---|
filter |
if specified only user names containing the supplied string will be returned |
Example response representations:
{
"size" : 1,
"limit" : 25,
"isLastPage" : true,
"values" : [ {
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
} ],
"start" : 0,
"filter" : null
}
A page of users.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Authentication failed or was not attempted.
Update the currently authenticated user's details. Note that the name attribute is ignored, the update will always be applied to the currently authenticated user.
Example request representations:
{
"name" : "jcitizen",
"displayName" : "Jane Citizen",
"email" : "jane@example.com"
}
Example response representations:
{
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
}
The updated user.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Authentication failed or was not attempted.
Update the currently authenticated user's password.
Example request representations:
{
"password" : "secret",
"passwordConfirm" : "secret",
"oldPassword" : "faithless"
}
Example response representations:
The user's password was successfully updated.
{
"errors" : [ {
"context" : "field_a",
"message" : "A detailed validation error message for field_a.",
"exceptionName" : null
}, {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The request was malformed or the old password was incorrect.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
Authentication failed or was not attempted.
Retrieve the user matching the supplied userSlug.
Example response representations:
{
"name" : "jcitizen",
"emailAddress" : "jane@example.com",
"id" : 101,
"displayName" : "Jane Citizen",
"active" : true,
"slug" : "jcitizen"
}
The user matching the supplied userSlug. Note, this may not be the user's username, always use the user.slug property.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The currently authenticated user has insufficient permissions to view the user.
{
"errors" : [ {
"context" : null,
"message" : "A detailed error message.",
"exceptionName" : null
} ]
}
The specified user does not exist.