---
title: Get the List of Roles from a clinic
slug: import-test-pdf/get-the-list-of-roles-from-a-clinic
createdAt: 2025-10-28T16:28:35.361Z
---

{
  "id": "YC3O_ELxihBcJYqz5FkA8",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/roles",
    "servers": [],
    "name": "Get the List of Roles from a clinic",
    "description": "Returns the Role list",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/paths/~1api~1v1~1roles~1%7Bid%7D/get/responses/200/content/application~1json/schema/properties/data",
                "customType": "data[]",
                "schema": []
              },
              {
                "name": "links",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/paths/~1api~1v1~1pets/get/responses/200/content/application~1json/schema/properties/links",
                "customType": "links",
                "schema": []
              },
              {
                "name": "meta",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/paths/~1api~1v1~1pets/get/responses/200/content/application~1json/schema/properties/meta",
                "customType": "meta",
                "schema": []
              },
              {
                "name": "permissions_groups",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "title",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Patients"
                  },
                  {
                    "name": "weight",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "permissions",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "integer",
                        "description": "",
                        "example": 1
                      },
                      {
                        "name": "title",
                        "kind": "optional",
                        "type": "string",
                        "description": "",
                        "example": "view_patients"
                      },
                      {
                        "name": "weight",
                        "kind": "optional",
                        "type": "integer",
                        "description": "",
                        "example": 1
                      },
                      {
                        "name": "depends_on",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/paths/~1api~1v1~1roles/get/responses/200/content/application~1json/schema/properties/permissions_groups/properties/permissions",
                        "customType": "permissions",
                        "schema": []
                      }
                    ]
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url /api/v1/roles \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "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(\"/api/v1/roles\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/v1/roles\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/api/v1/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": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// successful operation\n{\n  \"data\": [\n    \"\"\n  ],\n  \"links\": {},\n  \"meta\": {},\n  \"permissions_groups\": {\n    \"id\": 1,\n    \"title\": \"Patients\",\n    \"weight\": 1,\n    \"permissions\": {\n      \"id\": 1,\n      \"title\": \"view_patients\",\n      \"weight\": 1,\n      \"depends_on\": {}\n    }\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}