Endpoint and Authentication

Please refer to the API overview section to get the API endpoint, query format and authentication process.

This section of the documentation shows how to list, create and manage your labels.

Labels

List

GET /api/labels

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "name": "iOS",
      "targets": 3,
      "created_at": "2018-01-07T19:33:21.894Z"
    },
    {
      "name": "Android",
      "targets": 5,
      "created_at": "2018-01-07T19:34:26.163Z"
    },
    {
      "name": "Other label",
      "targets": 1,
      "created_at": "2018-01-04T10:51:38.402Z"
    },
  ]
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Create

POST /api/labels

Body Parameters

Property Type Description Default
name string A name for your label, to show on labelled targets (can include spaces) required

Example

{
    "name": "iOS",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "iOS",
    "targets": 0,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Update

PUT /api/labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to rename required

Body Parameters

Property Type Description Default
new_name string The new name for your label required

Example

{
    "new_name": "Android",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Label not found"
}

Delete

DELETE /api/labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to delete required

Response

Status: 204 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Label not found"
}