---
title: List labels
slug: project-api/list-labels
docTags: 
createdAt: 2024-06-10T16:48:55.566Z
---

{
  "id": "WSRrtr6x9wQcnPXkUXDMr",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.catenda.com/v2/projects/{project-id}/labels",
    "servers": [
      {
        "url": "https://api.catenda.com/v2/projects/{project-id}/labels"
      }
    ],
    "name": "List labels",
    "description": "List all the labels.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project-id",
          "type": "string",
          "example": "af2d8af0fa54465b89bf26dd3d92cfd0",
          "description": "Catenda project id"
        }
      ],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "include",
          "type": "string",
          "description": "<p>Use value <code>group</code> to include associated label group in the result</p>"
        },
        {
          "kind": "optional",
          "name": "search",
          "type": "string",
          "description": "Filter by label name"
        },
        {
          "kind": "optional",
          "name": "id",
          "type": "string",
          "description": "Filter by label ids providing a comma separated list\n"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "label[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "Id of the label",
                "example": "397t0ccc8f74619096c738de15dc6512"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "Name of the label",
                "example": "Label 1"
              },
              {
                "name": "color",
                "kind": "optional",
                "type": "string",
                "description": "Valid RGB hexadecimal color of the label",
                "example": "#6aa84f"
              },
              {
                "name": "group",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/label-group",
                "customType": "label-group",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": "Id of the label group",
                    "example": "357t0ccc8f74719096c734de18fc6512"
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Name of the label group",
                    "example": "Group name"
                  }
                ]
              },
              {
                "name": "deleted",
                "kind": "optional",
                "type": "boolean",
                "description": "Soft deletion state of the label",
                "example": false
              }
            ],
            "modelRef": "#/components/schemas/label",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "Lto0pk55cwGZNtNlvaITz",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.catenda.com/v2/projects/{project-id}/labels \\\n     --header 'accept: application/json'"
        },
        {
          "id": "a6ENKqZqvC4OqmdZScj4d",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.catenda.com/v2/projects/{project-id}/labels\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "4r5wUEcvkFctwTmcW46Q2",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.catenda.com/v2/projects/{project-id}/labels\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "xRWEYLxhMwpWQN9mC3JfS",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.catenda.com/v2/projects/{project-id}/labels\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Lto0pk55cwGZNtNlvaITz"
    },
    "results": {
      "languages": [
        {
          "id": "bp4rkht8cqI24a_E9zfkG",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"id\": \"397t0ccc8f74619096c738de15dc6512\",\n    \"name\": \"Label 1\",\n    \"color\": \"#6aa84f\",\n    \"group\": {\n      \"id\": \"357t0ccc8f74719096c734de18fc6512\",\n      \"name\": \"Group name\"\n    },\n    \"deleted\": false\n  }\n]"
        }
      ],
      "selectedLanguageId": "bp4rkht8cqI24a_E9zfkG"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}