{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":565,"path":"api-reference/rest-apis/user-role-inheritance-api.md","title":"User Role Inheritance API","bundle":null,"doc_type":null,"release":"australia","body":"\n# User Role Inheritance API\n\nThe User Role Inheritance API provides endpoints that allow you to see the roles that a specific user inherited.\n\nThis API requires the Contextual Security: Role Management V2 REST API \\(com.glide.role\\_management.inh\\_count.rest\\_api\\) plugin, automatically activated on new instances starting with the Jakarta release, or the Contextual Security: Role Management Enhancements REST API plugin, automatically activated starting with the Geneva release. The Contextual Security: Role Management V2 REST API is dependent on the Contextual Security: Role Management V2 \\(com.glide.role\\_management.inh\\_count\\) plugin.\n\nA user’s role can be directly granted, inherited from other roles, or inherited from groups. You must have the user\\_admin role to access this API.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## User Role Inheritance - GET /global/user\\_role\\_inheritance\n\nReturns a specified user's granted and inherited roles.\n\n### URL format\n\nVersioned URL: `/api/global/{api_version}/user_role_inheritance`\n\nDefault URL: `/api/global/user_role_inheritance`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|user\\_sysid|Required. Sys\\_id of the user for which to return role information.|\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|404|Not found. The requested item wasn't found.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nfrom\\_group\n\n</td><td>\n\nList of roles that are inherited from groups that have roles.Data type: Array\n\n</td></tr><tr><td>\n\nfrom\\_role\n\n</td><td>\n\nList of roles that are either granted directly or inherited from other roles.Data type: Array\n\n</td></tr><tr><td>\n\nuser\\_name\n\n</td><td>\n\nFull name of user.Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl \"https://instance.service-now.com/api/global/user_role_inheritance?user_sysid=62826bf03710200044e0bfc8bcbe5df1\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user \"username\":\"password\"\n\n```\n\n```\n{\n  \"result\": {\n    \"user_name\": \"abel.tuter\",\n    \"from_group\": [\n      \"[Azure Operators]/sn_azure.operator\",\n      \"[Azure Operators]/sn_azure.operator/sn_azure.user\"\n    ],\n    \"from_role\": [\n      \"/snc_internal\",\n      \"/cloud_user\",\n      \"/cloud_user/pa_viewer\",\n      \"/cloud_user/sn_azure.user\",\n      \"/cloud_user/aws_user\"\n    ]\n  }\n}\n```\n\n"}}