---
updatedAt: 2026-08-27T12:42:23.000Z
---

# Get eligible roles and bundles for the authenticated user

Returns all roles and bundles that the authenticated user is eligible to request access to. Organization tokens must pass `userId` to specify which user to query on behalf of. Admin personal tokens may optionally pass `userId` to query on behalf of another user. Non-admin personal tokens may only pass their own `userId`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "paths": {
    "/public/v1/eligibleJitAccess": {
      "get": {
        "description": "Returns all roles and bundles that the authenticated user is eligible to request access to. Organization tokens must pass `userId` to specify which user to query on behalf of. Admin personal tokens may optionally pass `userId` to query on behalf of another user. Non-admin personal tokens may only pass their own `userId`.",
        "operationId": "EligibleJitAccess_index",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "perPage",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 100,
              "type": "number"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter results to only roles or only bundles.",
            "schema": {
              "type": "string",
              "enum": [
                "role",
                "bundle"
              ]
            }
          },
          {
            "name": "userId",
            "required": false,
            "in": "query",
            "description": "Required when using an organization token. Accepts a UUID or email address. Admin personal tokens may pass this to query on behalf of another user. Regular users may only pass their own userId.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Matches against role name, resource name, integration name, bundle name, description, tags, and role permissions.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EligibleJitAccessIndexResponseSchema"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get eligible roles and bundles for the authenticated user",
        "tags": [
          "Public",
          "Eligible JIT Access"
        ]
      }
    }
  },
  "info": {
    "title": "Entitle API",
    "description": "Entitle API documentation",
    "version": "1.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.entitle.io"
    },
    {
      "url": "https://api.us.entitle.io"
    },
    {
      "url": "https://api.ca.entitle.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      },
      "csrf-token": {
        "type": "apiKey",
        "in": "header",
        "name": "csrf-token",
        "description": "CSRF token required for state-changing requests"
      }
    },
    "schemas": {
      "ApplicationResponseSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the application"
          }
        },
        "required": [
          "name"
        ]
      },
      "IntegrationBaseResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000",
            "description": "Unique identifier for the integration"
          },
          "name": {
            "type": "string",
            "description": "Display name for the integration"
          },
          "application": {
            "description": "Application metadata without sensitive values",
            "allOf": [
              {
                "$ref": "#/components/schemas/ApplicationResponseSchema"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "application"
        ]
      },
      "IntegrationResourceListItemResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the resource",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "name": {
            "type": "string",
            "description": "Display name for the resource"
          },
          "integration": {
            "description": "Integration details for this resource",
            "allOf": [
              {
                "$ref": "#/components/schemas/IntegrationBaseResponseSchema"
              }
            ]
          },
          "externalId": {
            "type": "string",
            "description": "The external identifier of the resource in the source system (e.g. full GCP resource path)."
          },
          "type": {
            "type": "string",
            "description": "The resource type label (e.g. 'Service account', 'buckets')."
          }
        },
        "required": [
          "id",
          "name",
          "integration",
          "externalId",
          "type"
        ]
      },
      "WorkflowSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the workflow",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "name": {
            "type": "string",
            "description": "Display name for the workflow"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "EnumAllowedDurations": {
        "type": "number",
        "enum": [
          1800,
          3600,
          10800,
          21600,
          43200,
          57600,
          86400,
          259200,
          604800,
          2628000,
          7884000,
          15768000,
          31536000,
          63072000,
          -1
        ],
        "description": "Allowed durations (in seconds) for access requests to this role. Inherits from parent resource if not explicitly set."
      },
      "IntegrationResourceRoleListItemResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the role",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "name": {
            "type": "string",
            "description": "Display name for the role"
          },
          "externalId": {
            "type": "string",
            "nullable": true,
            "description": "The external identifier of the role in the source system (e.g. the ID assigned by AWS, GitHub, etc.)."
          },
          "resource": {
            "description": "Resource details for this role",
            "allOf": [
              {
                "$ref": "#/components/schemas/IntegrationResourceListItemResponseSchema"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "externalId",
          "resource"
        ]
      },
      "IntegrationResourceRoleResultSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the role",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "name": {
            "type": "string",
            "description": "Display name for the role"
          },
          "externalId": {
            "type": "string",
            "nullable": true,
            "description": "The external identifier of the role in the source system (e.g. the ID assigned by AWS, GitHub, etc.)."
          },
          "resource": {
            "description": "Resource details for this role",
            "allOf": [
              {
                "$ref": "#/components/schemas/IntegrationResourceListItemResponseSchema"
              }
            ]
          },
          "requestable": {
            "type": "boolean",
            "description": "Indicates if the role is requestable"
          },
          "workflow": {
            "nullable": true,
            "description": "Workflow associated with the role",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowSchema"
              }
            ]
          },
          "allowedDurations": {
            "type": "array",
            "description": "Allowed durations (in seconds) for access requests to this role. Inherits from parent resource if not explicitly set.",
            "items": {
              "$ref": "#/components/schemas/EnumAllowedDurations"
            }
          },
          "prerequisitePermissions": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PrerequisiteRolePermissionResponseSchema"
                  }
                ]
              }
            },
            "description": "Resolved prerequisite permissions grouped by any-of/all-of sets. Outer array represents OR logic (any set can match), inner arrays represent AND logic (all permissions in a set must match)."
          },
          "virtualizedRole": {
            "description": "Virtualized role details",
            "allOf": [
              {
                "$ref": "#/components/schemas/IntegrationResourceRoleListItemResponseSchema"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "externalId",
          "resource",
          "requestable",
          "workflow",
          "allowedDurations",
          "prerequisitePermissions",
          "virtualizedRole"
        ]
      },
      "WorkflowResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier for the workflow"
          },
          "name": {
            "type": "string",
            "description": "Display name for the workflow"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "ResourceResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier for the resource"
          },
          "name": {
            "type": "string",
            "description": "Display name for the resource"
          },
          "externalId": {
            "type": "string",
            "description": "The external identifier of the resource in the source system (e.g. full GCP resource path)."
          },
          "type": {
            "type": "string",
            "description": "The resource type label (e.g. 'Service account', 'buckets')."
          },
          "integration": {
            "description": "Integration details for this resource",
            "allOf": [
              {
                "$ref": "#/components/schemas/IntegrationBaseResponseSchema"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "externalId",
          "type",
          "integration"
        ]
      },
      "BundleItemResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier for the role"
          },
          "name": {
            "type": "string",
            "description": "Display name for the role"
          },
          "resource": {
            "description": "Resource details for this role",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceResponseSchema"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "resource"
        ]
      },
      "FullBundleResultResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier for the bundle"
          },
          "name": {
            "type": "string",
            "description": "Display name for the bundle"
          },
          "workflow": {
            "description": "Workflow associated with this bundle, containing workflow ID and name.",
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowResponseSchema"
              }
            ]
          },
          "allowedDurations": {
            "type": "array",
            "nullable": true,
            "description": "Allowed durations (in seconds) for access requests to roles in this bundle.",
            "items": {
              "$ref": "#/components/schemas/EnumAllowedDurations"
            }
          },
          "category": {
            "type": "string",
            "nullable": true,
            "description": "Category of the bundle"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Description of the bundle"
          },
          "tags": {
            "nullable": true,
            "description": "Tags for the bundle",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "roles": {
            "description": "Roles included in the bundle",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BundleItemResponseSchema"
            }
          }
        },
        "required": [
          "id",
          "name",
          "workflow",
          "allowedDurations",
          "category",
          "description",
          "tags",
          "roles"
        ]
      },
      "PaginationResponseSchema": {
        "type": "object",
        "properties": {
          "page": {
            "type": "number",
            "description": "Current page",
            "minimum": 1
          },
          "perPage": {
            "type": "number",
            "description": "Number of results per page",
            "minimum": 1,
            "maximum": 100
          },
          "totalResults": {
            "type": "number",
            "description": "Total number of results"
          },
          "totalPages": {
            "type": "number",
            "description": "Total number of pages"
          }
        },
        "required": [
          "page",
          "perPage",
          "totalResults",
          "totalPages"
        ]
      },
      "EligibleJitAccessIndexResponseSchema": {
        "type": "object",
        "properties": {
          "roles": {
            "description": "Roles eligible for the user",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationResourceRoleResultSchema"
            }
          },
          "bundles": {
            "description": "Bundles eligible for the user",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FullBundleResultResponseSchema"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationResponseSchema"
          }
        },
        "required": [
          "roles",
          "bundles",
          "pagination"
        ]
      },
      "PrerequisiteRolePermissionResponseSchema": {
        "type": "object",
        "properties": {
          "default": {
            "type": "boolean",
            "description": "Indicates if this permission is the default for the role"
          },
          "role": {
            "description": "Display name for the role",
            "allOf": [
              {
                "$ref": "#/components/schemas/IntegrationResourceRoleListItemResponseSchema"
              }
            ]
          }
        },
        "required": [
          "default",
          "role"
        ]
      }
    }
  },
  "security": [
    {
      "csrf-token": []
    }
  ]
}
```