/api/ee/permission_debug

GET /api/ee/permission_debug

Changed on

This endpoint expects a user_id, a model_id to debug permissions against, and action_type. The type of model we are debugging against is inferred by the action_type.

It will return:

  • decision: The overall permission decision ("allow", "denied", or "limited")
  • model-type: The type of model being checked (e.g., "question")
  • model-id: The ID of the model being checked
  • segment: A set of segmentation types applied (e.g., "sandboxed", "impersonated", "routed")
  • message: A sequence of strings explaining the decision
  • data: A map containing details about permissions (table or collection names to group names)
  • suggestions: A map of group IDs to group names that could provide access

Example requests:

  • Check if user can read a card: GET /api/ee/permission_debug?user_id=123&model_id=456&action_type=card/read
  • Check if user can query a card: GET /api/ee/permission_debug?user_id=123&model_id=456&action_type=card/query
  • Check if user can download data: GET /api/ee/permission_debug?user_id=123&model_id=456&action_type=card/download-data

Example responses:

  • Allowed access:
    {
      "decision": "allow",
      "model-type": "question",
      "model-id": "456",
      "segment": [],
      "message": ["User has permission to read this card"],
      "data": {},
      "suggestions": {}
    }
    
  • Denied access with blocked table:
    {
      "decision": "denied",
      "model-type": "question",
      "model-id": "456",
      "segment": [],
      "message": ["User does not have permission to query this card"],
      "data": {"sample-db.PUBLIC.ORDERS": ["All Users"]},
      "suggestions": {}
    }
    
  • Limited access:
    {
      "decision": "limited",
      "model-type": "question",
      "model-id": "456",
      "segment": [],
      "message": ["User has permission to download some data from this card"],
      "data": {},
      "suggestions": {}
    }
    
get/api/ee/permission_debug

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Query parameters

user_idinteger required
model_idinteger required

value must be an integer greater than zero.

action_type'card/read' | 'card/query' | 'card/download-data' required

Request body

object required

Response

Successful response

decision'allow' | 'denied' | 'limited' required
messagestring[] required
model-idstring required
model-type'card' | 'invalid' required
segmentstring[] required
suggestionsobject required

Changes

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • breaking

      for the query request parameter model_id, the type changed from string to integer

    • warning

      for the query request parameter model_id, the min was set to 1.00

    • info

      added optional request body