Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2014-08-12 16:16:25 +0400
committerRobert Schilling <rschilling@student.tugraz.at>2014-08-13 14:28:19 +0400
commit9284038dbef5153dac40eda14f1685a72efe1d1a (patch)
tree1b195e94518f115316da6f98195943dc8d22c2c0 /doc/api/labels.md
parent53ead2e35c9195ae1f68bf5d7154e341636caf1b (diff)
Add, delete labels via API
Diffstat (limited to 'doc/api/labels.md')
-rw-r--r--doc/api/labels.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/api/labels.md b/doc/api/labels.md
new file mode 100644
index 00000000000..a83d28107cc
--- /dev/null
+++ b/doc/api/labels.md
@@ -0,0 +1,63 @@
+# Labels
+
+## List labels
+
+Get all labels for given project.
+
+```
+GET /projects/:id/labels
+```
+
+```json
+[
+ {
+ "name": "Awesome",
+ "color": "#DD10AA"
+ },
+ {
+ "name": "Documentation",
+ "color": "#1E80DD"
+ },
+ {
+ "name": "Feature",
+ "color": "#11FF22"
+ },
+ {
+ "name": "Bug",
+ "color": "#EE1122"
+ }
+]
+```
+
+## Create a new label
+
+Creates a new label for given repository with given name and color.
+
+```
+POST /projects/:id/labels
+```
+
+Parameters:
+
+- `id` (required) - The ID of a project
+- `name` (required) - The name of the label
+- `color` (required) - Color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB)
+
+It returns 200 and the newly created label, if the operation succeeds.
+If the label already exists, 409 and an error message is returned.
+If label parameters are invalid, 405 and an explaining error message is returned.
+
+## Delete a label
+
+Deletes a label given by its name.
+
+```
+DELETE /projects/:id/labels
+```
+
+- `id` (required) - The ID of a project
+- `name` (required) - The name of the label to be deleted
+
+It returns 200 if the label successfully was deleted, 404 for wrong parameters
+and 400 if the label does not exist.
+In case of an error, additionally an error is returned.