POST
/v1/mgmt/fga/check

Authorization

Descope Project ID and Management Key
AuthorizationBearer <token>

Project ID:Management Key as bearer token.

In: header

Request Body

application/json

tuples?array<Tuple>
computePaths?boolean

Check FGA permission

This endpoint allows you to check if a target has a specific relation to a resource using Fine-Grained Authorization.

curl -X POST "https://api.descope.com/v1/mgmt/fga/check" \  -H "Content-Type: application/json" \  -d '{}'
{  "tuples": [    {      "allowed": true,      "tuple": {        "resource": "document-123",        "resourceType": "doc",        "relation": "editor",        "target": "user-456",        "targetType": "user"      },      "info": {        "direct": true,        "path": {          "steps": [            {              "stepType": 0,              "tuple": {                "resource": "document-123",                "resourceType": "doc",                "relation": "editor",                "target": "user-456",                "targetType": "user"              },              "permission": "string",              "subPaths": [                {                  "steps": []                }              ]            }          ]        }      }    }  ]}
export interface Response {tuples?: CheckResponseTuple[]}export interface CheckResponseTuple {allowed?: booleantuple?: {/** * The resource identifier. */resource?: string/** * The type of the resource. */resourceType?: string/** * The relation between the resource and the target. */relation?: string/** * The target identifier (user, group, etc.). */target?: string/** * The type of the target. */targetType?: string}info?: CheckResponseInfo}export interface CheckResponseInfo {/** * A relation is considered "direct" if, based solely on the schema, its "allowed" state can only be *  changed by creating or deleting relations involving its resource, its target, or both (including itself) */direct?: boolean/** * if the check succeeded, includes the full path of intermediate relations between the target and the resource */path?: {steps?: CheckPathStep[]}}export interface CheckPathStep {stepType?: numbertuple?: {/** * The resource identifier. */resource?: string/** * The type of the resource. */resourceType?: string/** * The relation between the resource and the target. */relation?: string/** * The target identifier (user, group, etc.). */target?: string/** * The type of the target. */targetType?: string}permission?: stringsubPaths?: CheckPath[]}export interface CheckPath {steps?: CheckPathStep[]}
Was this helpful?