---
title: List user roles
slug: api-guide/list-user-roles
docTags: 
createdAt: 2025-01-16T08:06:24.215Z
---

{
  "id": "BaCf2AnDytiFFmA8qSOQU",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.app.kognic.com/v2/user-roles",
    "servers": [
      {
        "url": "https://api.app.kognic.com/v2/user-roles"
      }
    ],
    "name": "List user roles",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Enveloped_Seq_UserRole",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/UserRole",
                "customType": "UserRole[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string<uuid>",
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Enveloped_Seq_UserRole",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Unauthorized",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Unauthorized",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Forbidden",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Forbidden",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "IMddWZRYcy5f5dy_lXVGr",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.app.kognic.com/v2/user-roles\"\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": "IMddWZRYcy5f5dy_lXVGr"
    },
    "results": {
      "languages": [
        {
          "id": "rSE3RVsjmBOG5duRduTYc",
          "language": "200",
          "code": "{\n  \"data\": [\n    {\n      \"id\": \"\",\n      \"name\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "CeH6v_oZYaHTcd5GXl6pi",
          "language": "401",
          "code": "// Unauthorized\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "ZwNmJMGUgeATc6NurJHDy",
          "language": "403",
          "code": "// Forbidden\n{\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "rSE3RVsjmBOG5duRduTYc"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}