summaryrefslogtreecommitdiff
path: root/doc/api/projects.md
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-24 13:36:45 +0100
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-24 18:58:42 +0100
commit3549d7c1d402c10c567c239b006132c45b0c0d1e (patch)
tree40bd6934eb753b8adf3dfaaa57957cdf932dfe1e /doc/api/projects.md
parent2c5bcf2e1b5b5574238555657296a8831b989d1e (diff)
downloadgitlab-ce-3549d7c1d402c10c567c239b006132c45b0c0d1e.tar.gz
PUT becomes POST on archiving endpoints
Also the specs have a minor improvement. Mainly the access right spec. Changes are reflected in the docs
Diffstat (limited to 'doc/api/projects.md')
-rw-r--r--doc/api/projects.md22
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/api/projects.md b/doc/api/projects.md
index 44d40235e9e..3a909a2bc87 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -493,14 +493,15 @@ Parameters:
### Archive a project
-Archives a project if the user has the right access level to this project. This action is
+Archives the project if the user is either admin or the project owner of this project. This action is
idempotent, thus archiving an already archived project will not change the project.
-Status code 200 with the project as body is given when successful, in case the user doesn't
-have the proper access rights, code 404 is returned.
+Status code 201 with the project as body is given when successful, in case the user doesn't
+have the proper access rights, code 403 is returned. Status 404 is returned if the project
+doesn't exist, or is hidden to the user.
```
-PUT /projects/:id/archive
+POST /projects/:id/archive
```
| Attribute | Type | Required | Description |
@@ -508,7 +509,7 @@ PUT /projects/:id/archive
| `id` | integer | yes | The ID of the project |
```bash
-curl -X PUT -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/archive"
+curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/archive"
```
Example response:
@@ -575,14 +576,15 @@ Example response:
### Unarchive a project
-Unarchives a project if the user has the right access level to this project. This action is
+Unarchives the project if the user is either admin or the project owner of this project. This action is
idempotent, thus unarchiving an non-archived project will not change the project.
-Status code 200 with the project as body is given when successful, in case the user doesn't
-have the proper access rights, code 404 is returned.
+Status code 201 with the project as body is given when successful, in case the user doesn't
+have the proper access rights, code 403 is returned. Status 404 is returned if the project
+doesn't exist, or is hidden to the user.
```
-PUT /projects/:id/archive
+POST /projects/:id/archive
```
| Attribute | Type | Required | Description |
@@ -590,7 +592,7 @@ PUT /projects/:id/archive
| `id` | integer | yes | The ID of the project |
```bash
-curl -X PUT -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/unarchive"
+curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/unarchive"
```
Example response: