---
title: Get combined roles for user at site
slug: api-documentation/get-combined-roles-for-user-at-site
docTags: 
createdAt: 2026-08-27T17:06:32.549Z
---

{
  "id": "mp6pr5r4dv_het74c5MpO",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.upstartcommerce.com/profile-permissions/users/{userId}/sites/{siteId}/roles",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/profile-permissions/users/{userId}/sites/{siteId}/roles",
        "description": "Production"
      }
    ],
    "name": "Get combined roles for user at site",
    "description": "<p>Returns the combined tenant roles + site roles for a user at a specific site.\nThis reflects the additive permission model where users at a site have\nBOTH their tenant roles AND their site-specific roles.</p>\n<p><strong>Required Permission:</strong> None if viewing own roles (userId matches token subject).\nOtherwise requires <code>profile-permissions.users.read</code>.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "userId",
          "type": "string<uuid>",
          "description": "User identifier",
          "format": "uuid"
        },
        {
          "kind": "required",
          "name": "siteId",
          "type": "string",
          "description": "Site identifier"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearerAuth",
          "name": "bearerAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>JWT token from authentication service.</p>\n<p>The token contains:</p>\n<ul>\n<li>sub: User ID</li>\n<li>tenant: Tenant ID (used for all operations)</li>\n<li>roles: Array of role IDs</li>\n<li>type: \"management\" or \"consumer\"</li>\n</ul>\n<p>Alternatively, tenant can be specified via X-Tenant-Id header.</p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Combined roles for user at site",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>A user's roles at one site, given both as the separate tenant and site contributions and as the combined list. Site roles are additive to tenant roles rather than a replacement for them.</p>",
            "customType": "UserSiteRolesResponse",
            "schema": [
              {
                "name": "userId",
                "kind": "required",
                "type": "string<uuid>",
                "description": "User identifier",
                "format": "uuid"
              },
              {
                "name": "siteId",
                "kind": "required",
                "type": "string",
                "description": "Site identifier"
              },
              {
                "name": "combinedRoleIds",
                "kind": "required",
                "type": "array",
                "description": "<p>Combined list of all role IDs (tenant + site)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "tenantRoleIds",
                "kind": "required",
                "type": "array",
                "description": "<p>Role IDs from tenant-level assignments</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "siteRoleIds",
                "kind": "required",
                "type": "array",
                "description": "<p>Role IDs from site-level assignments</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/UserSiteRolesResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Missing or invalid authentication token",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Error payload identifying the failure by error code and message, with optional detail.</p>",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>",
                "description": "Error code",
                "example": "not_found",
                "enum": [
                  "bad_request",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "internal_error"
                ]
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>Human-readable error message</p>",
                "example": "Role not found"
              },
              {
                "name": "details",
                "kind": "optional",
                "type": "map",
                "description": "Additional error details",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "User or site not found",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Error payload identifying the failure by error code and message, with optional detail.</p>",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>",
                "description": "Error code",
                "example": "not_found",
                "enum": [
                  "bad_request",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "internal_error"
                ]
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>Human-readable error message</p>",
                "example": "Role not found"
              },
              {
                "name": "details",
                "kind": "optional",
                "type": "map",
                "description": "Additional error details",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "Internal server error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Error payload identifying the failure by error code and message, with optional detail.</p>",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>",
                "description": "Error code",
                "example": "not_found",
                "enum": [
                  "bad_request",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "internal_error"
                ]
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>Human-readable error message</p>",
                "example": "Role not found"
              },
              {
                "name": "details",
                "kind": "optional",
                "type": "map",
                "description": "Additional error details",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "wl7edaanzxdhMK9fGk_zO",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.upstartcommerce.com/profile-permissions/users/{userId}/sites/{siteId}/roles \\\n     --header 'accept: application/json'"
        },
        {
          "id": "t69YMK6FdvTa_nQalsQ65",
          "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.upstartcommerce.com/profile-permissions/users/{userId}/sites/{siteId}/roles\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "-OWSEum4YihdV_5SIEvlt",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/profile-permissions/users/{userId}/sites/{siteId}/roles\")\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": "46jzQhdjXX1cYt4DeAut_",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/profile-permissions/users/{userId}/sites/{siteId}/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": "wl7edaanzxdhMK9fGk_zO"
    },
    "results": {
      "languages": [
        {
          "id": "_5feAlq-9sMoKpwrYGT9L",
          "language": "200",
          "code": "// Combined roles for user at site\n{\n  \"userId\": \"\",\n  \"siteId\": \"\",\n  \"combinedRoleIds\": [\n    \"\"\n  ],\n  \"tenantRoleIds\": [\n    \"\"\n  ],\n  \"siteRoleIds\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "6rBqtuB4klwUZI6SN3TWa",
          "language": "401",
          "code": "// Missing or invalid authentication token\n{\n  \"error\": \"not_found\",\n  \"message\": \"Role not found\",\n  \"details\": \"\"\n}"
        },
        {
          "id": "w5yRhQR3s-cJNUrNrmmwU",
          "language": "404",
          "code": "// User or site not found\n{\n  \"error\": \"not_found\",\n  \"message\": \"Role not found\",\n  \"details\": \"\"\n}"
        },
        {
          "id": "RT0M93cGxANN3WJ11I2jv",
          "language": "500",
          "code": "// Internal server error\n{\n  \"error\": \"not_found\",\n  \"message\": \"Role not found\",\n  \"details\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "_5feAlq-9sMoKpwrYGT9L"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}