---
title: Get all permissions for a user
slug: api-documentation/get-all-permissions-for-a-user
docTags: 
createdAt: 2026-08-27T17:06:32.549Z
---

{
  "id": "3T3ewPHcbbwz3aDTiedj5",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions",
        "description": "Production"
      }
    ],
    "name": "Get all permissions for a user",
    "description": "<p>Returns all permissions the user has, including the source of each permission\n(which role granted it).</p>\n<p><strong>Required Permission:</strong> None if viewing own permissions (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"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "prefix",
          "type": "string",
          "example": "order",
          "description": "<p>Filter permissions by prefix (e.g., \"order\" returns order.read, order.write, etc.)</p>"
        }
      ],
      "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": "List of user permissions",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Every permission a user holds, each with the roles it came from.</p>",
            "customType": "UserPermissionsResponse",
            "schema": [
              {
                "name": "userId",
                "kind": "required",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "permissions",
                "kind": "required",
                "type": "array",
                "description": "<p>A single permission a user holds, and all of the roles that grant it.</p>",
                "modelRef": "#/components/schemas/UserPermission",
                "customType": "UserPermission[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Permission name",
                    "example": "order.read"
                  },
                  {
                    "name": "permissionDescription",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Human-readable description</p>"
                  },
                  {
                    "name": "sources",
                    "kind": "required",
                    "type": "array",
                    "description": "All roles that grant this permission to the user",
                    "example": "[\"role:operator\",\"role:admin\"]",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "grantedAt",
                    "kind": "required",
                    "type": "string<date-time>",
                    "description": "<p>When the permission was first granted (earliest across all sources)</p>",
                    "format": "date-time"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/UserPermissionsResponse",
            "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 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": "Os-ZEuobTjV1MFNddgIen",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions \\\n     --header 'accept: application/json'"
        },
        {
          "id": "yEfOUE33f3YmY5fPv0Jy1",
          "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}/permissions\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "EO_NcbjnnNVngKlbh7BwW",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions\")\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": "07XirFDWT7DTFTG2X_53K",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions\"\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": "Os-ZEuobTjV1MFNddgIen"
    },
    "results": {
      "languages": [
        {
          "id": "gk1hKBS7jH3JZmHcDEfjS",
          "language": "200",
          "code": "// List of user permissions\n{\n  \"userId\": \"\",\n  \"permissions\": [\n    {\n      \"name\": \"order.read\",\n      \"permissionDescription\": \"\",\n      \"sources\": [\n        \"\"\n      ],\n      \"grantedAt\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "PMv0bY3dMEyq-TVosaO4i",
          "language": "401",
          "code": "// Missing or invalid authentication token\n{\n  \"error\": \"not_found\",\n  \"message\": \"Role not found\",\n  \"details\": \"\"\n}"
        },
        {
          "id": "xYRFTmwg133Dq5sBne2QT",
          "language": "404",
          "code": "// User not found\n{\n  \"error\": \"not_found\",\n  \"message\": \"Role not found\",\n  \"details\": \"\"\n}"
        },
        {
          "id": "8gFX_2KuzK-MQKYRRzRJF",
          "language": "500",
          "code": "// Internal server error\n{\n  \"error\": \"not_found\",\n  \"message\": \"Role not found\",\n  \"details\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "gk1hKBS7jH3JZmHcDEfjS"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}