A label is a name that classifies an issue. Issues can have zero or more labels. The set of allowed labels is defined per project.
id
- Unique and stable global identifier of a label- mandatory
- non editable, auto-assigned
- type: number
- example:
1
number
- Stable identifier of a label relative to a project- mandatory
- non editable, auto-assigned
- type: number
- example:
1
name
- Short name that defines the label. The name is unique per project- mandatory
- editable
- type: text
- example:
"My Label"
project
- Name of the project where the label is contained- mandatory
- non editable, auto-assigned
- type: text
- example:
"My Project"
projectId
- Id of the project where the label is contained- mandatory
- non editable, auto-assigned
- type: nuymber
- example:
1
author
- Name of the label's creator- mandatory
- non editable, auto-assigned
- type: text
- example:
"John Doe"
authorId
- Id of the label's creator- mandatory
- non editable, auto-assigned
- type: number
- example:
1
- List Labels
- Get Label
- Create Label
- Edit Label
- Delete Label
- List Issue Labels
- Add Label To Issue
- Remove Label From Issue
List all project labels, in the order that they were created.
GET /api/projects/{projectId}/labels
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
projectId | integer | path | The project's unique identifier |
page | integer | query | Specifies the current page of the list |
limit | integer | query | Specifies the number of results per page (max. 100) |
Status: 200 OK
{
"class": ["label", "collection"],
"properties": {
"collectionSize": 2,
"pageIndex": 0,
"pageSize": 2
},
"entities": [
{
"class": ["label"],
"rel": ["item"],
"properties": {
"id": 1,
"number": 1,
"name": "label 1",
"project": "project 1",
"projectId": 1,
"author": "user1",
"authorId": 1
},
"links": [
{
"rel": ["self"],
"href": "/api/projects/1/labels/1"
},
{
"rel": ["project"],
"href": "/api/projects/1"
},
{
"rel": ["author"],
"href": "/api/users/1"
},
{
"rel": ["labels"],
"href": "/api/projects/1/labels"
}
]
},
{
"class": ["label"],
"rel": ["item"],
"properties": {
"id": 2,
"number": 2,
"name": "label 2",
"project": "project 1",
"projectId": 1,
"author": "user1",
"authorId": 1
},
"links": [
{
"rel": ["self"],
"href": "/api/projects/1/labels/2"
},
{
"rel": ["project"],
"href": "/api/projects/1"
},
{
"rel": ["author"],
"href": "/api/users/1"
},
{
"rel": ["labels"],
"href": "/api/projects/1/labels"
}
]
}
],
"actions": [
{
"name": "create-label",
"title": "Create Label",
"method": "POST",
"href": "/api/projects/1/labels",
"type": "application/json",
"fields": [
{
"name": "projectId",
"type": "hidden",
"value": 1
},
{
"name": "name",
"type": "text"
}
]
}
],
"links": [
{
"rel": ["self"],
"href": "/api/projects/1/labels?page=0&limit=10"
},
{
"rel": ["page"],
"hrefTemplate": "/api/projects/1/labels{?page,limit}"
},
{
"rel": ["project"],
"href": "/api/projects/1"
}
]
}
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 404 Not Found
Get a single project label.
GET /api/projects/{projectId}/labels/{labelNumber}
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
projectId | integer | path | The project's unique identifier |
labelNumber | integer | path | The label's identifier relative to the project |
Status: 200 OK
{
"class": ["label"],
"properties": {
"id": 1,
"number": 1,
"name": "label 1",
"project": "project 1",
"projectId": 1,
"author": "user1",
"authorId": 1
},
"actions": [
{
"name": "edit-label",
"title": "Edit Label",
"method": "PUT",
"href": "/api/projects/1/labels/1",
"type": "application/json",
"fields": [
{
"name": "projectId",
"type": "hidden",
"value": 1
},
{
"name": "labelNumber",
"type": "hidden",
"value": 1
},
{
"name": "name",
"type": "text"
}
]
},
{
"name": "delete-label",
"title": "Delete Label",
"method": "DELETE",
"href": "/api/projects/1/labels/1",
"fields": [
{
"name": "projectId",
"type": "hidden",
"value": 1
},
{
"name": "labelNumber",
"type": "hidden",
"value": 1
}
]
}
],
"links": [
{
"rel": ["self"],
"href": "/api/projects/1/labels/1"
},
{
"rel": ["project"],
"href": "/api/projects/1"
},
{
"rel": ["author"],
"href": "/api/users/1"
},
{
"rel": ["labels"],
"href": "/api/projects/1/labels"
}
]
}
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 404 Not Found
Create a project label.
POST /api/projects/{projectId}/labels
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
content-type | string | header | Should be set to application/json |
projectId | integer | path | The project's unique identifier |
name | string | body | Required. Unique (within the project) and short name that defines the label |
Status: 201 Created
Location: /api/projects/{projectId}/labels/{labelNumber}
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 409 Conflict
Edit an already existing project label.
PUT /api/projects/{projectId}/labels/{labelNumber}
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
content-type | string | header | Should be set to application/json |
projectId | integer | path | The project's unique identifier |
labelNumber | integer | path | The label's identifier relative to the project |
name | string | body | Required. Unique and short name that defines the label |
Status: 200 OK
Location: /api/projects/{projectId}/labels/{labelNumber}
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 404 Not Found
Status: 409 Conflict
Delete an existing project label.
DELETE /api/projects/{projectId}/labels/{labelNumber}
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
projectId | integer | path | The project's unique identifier |
labelNumber | integer | path | The label's identifier relative to the project |
Status: 200 OK
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 404 Not Found
Status: 409 Conflict
List the issue's current labels, in the order that they were created.
GET /api/projects/{projectId}/issues/{issueNumber}/labels
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
projectId | integer | path | The project's unique identifier |
issueNumber | integer | path | The issue's identifier relative to the project |
page | integer | query | Specifies the current page of the list |
limit | integer | query | Specifies the number of results per page (max. 100) |
Status: 200 OK
{
"class": ["label", "collection"],
"properties": {
"collectionSize": 2,
"pageIndex": 0,
"pageSize": 2
},
"entities": [
{
"class": ["label"],
"rel": ["item"],
"properties": {
"id": 1,
"number": 1,
"name": "label 1",
"project": "project 1",
"projectId": 1,
"author": "user1",
"authorId": 1
},
"actions": [
{
"name": "delete-label-from-issue",
"title": "Delete Label From Issue",
"method": "DELETE",
"href": "/api/projects/1/issues/1/labels/1",
"fields": [
{
"name": "projectId",
"type": "hidden",
"value": 1
},
{
"name": "issueNumber",
"type": "hidden",
"value": 1
},
{
"name": "labelNumber",
"type": "hidden",
"value": 1
}
]
}
],
"links": [
{
"rel": ["self"],
"href": "/api/projects/1/issues/1/labels/1"
},
{
"rel": ["issue"],
"href": "/api/projects/1/issues/1"
},
{
"rel": ["project"],
"href": "/api/projects/1"
},
{
"rel": ["author"],
"href": "/api/users/1"
},
{
"rel": ["labels"],
"href": "/api/projects/1/issues/1/labels"
}
]
},
{
"class": ["label"],
"rel": ["item"],
"properties": {
"id": 2,
"number": 2,
"name": "label 2",
"project": "project 1",
"projectId": 1,
"author": "user1",
"authorId": 1
},
"actions": [
{
"name": "delete-label-from-issue",
"title": "Delete Label From Issue",
"method": "DELETE",
"href": "/api/projects/1/issues/1/labels/2",
"fields": [
{
"name": "projectId",
"type": "hidden",
"value": 1
},
{
"name": "issueNumber",
"type": "hidden",
"value": 1
},
{
"name": "labelNumber",
"type": "hidden",
"value": 2
}
]
}
],
"links": [
{
"rel": ["self"],
"href": "/api/projects/1/issues/1/labels/2"
},
{
"rel": ["issue"],
"href": "/api/projects/1/issues/1"
},
{
"rel": ["project"],
"href": "/api/projects/1"
},
{
"rel": ["author"],
"href": "/api/users/1"
},
{
"rel": ["labels"],
"href": "/api/projects/1/issues/1/labels"
}
]
}
],
"actions": [
{
"name": "add-label-to-issue",
"title": "Add Label To Issue",
"method": "PUT",
"href": "/api/projects/1/issues/1/labels",
"type": "application/json",
"fields": [
{
"name": "projectId",
"type": "hidden",
"value": 1
},
{
"name": "issueNumber",
"type": "hidden",
"value": 1
},
{
"name": "name",
"type": "text"
}
]
}
],
"links": [
{
"rel": ["self"],
"href": "/api/projects/1/issues/1/labels?page=0&limit=10"
},
{
"rel": ["page"],
"hrefTemplate": "/api/projects/1/issues/1/labels{?page,limit}"
},
{
"rel": ["project"],
"href": "/api/projects/1"
},
{
"rel": ["issue"],
"href": "/api/projects/1/issues/1"
}
]
}
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 404 Not Found
Add a existing label to an issue.
PUT /api/projects/{projectId}/issues/{issueNumber}/labels
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
content-type | string | header | Should be set to application/json |
projectId | integer | path | The project's unique identifier |
issueNumber | integer | path | The issue's identifier relative to the project |
name | string | body | Required. Unique (within the project) and short name that defines the label |
Status: 201 Created
Location: /api/projects/{projectId}/issues/{issueNumber}/labels
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 404 Not Found
Status: 409 Conflict
Remove a existing label from an issue.
DELETE /api/projects/{projectId}/issues/{issueNumber}/labels/{labelNumber}
Name | Type | In | Description |
---|---|---|---|
accept | string | header | Should be set to either application/json or application/vnd.siren+json |
projectId | integer | path | The project's unique identifier |
issueNumber | integer | path | The issue's identifier relative to the project |
labelNumber | integer | path | The label's identifier relative to the project |
Status: 200 OK
Status: 400 Bad Request
Status: 401 Unauthorized
Status: 404 Not Found