> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leen.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List IDP Policies

> List all the IDP policies for a given connection. Use /policies/{policy_id}/groups, /policies/{policy_id}/applications, and /policies/{policy_id}/users to get related entities with proper pagination.



## OpenAPI

````yaml get /idp/policies
openapi: 3.1.0
info:
  title: Leen Security API
  version: 0.0.1
servers:
  - url: https://api.leen.dev/v1
    description: Production API
  - url: https://api.eu-c1.leen.dev/v1
    description: Production API (EU Region)
  - url: https://api.ap-se2.leen.dev/v1
    description: Production Api (APAC Region)
security: []
paths:
  /idp/policies:
    get:
      tags:
        - idp
      summary: List IDP Policies
      description: >-
        List all the IDP policies for a given connection. Use
        /policies/{policy_id}/groups, /policies/{policy_id}/applications, and
        /policies/{policy_id}/users to get related entities with proper
        pagination.
      operationId: list_idp_policies
      parameters:
        - name: enableCursor
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Enable cursor based pagination instead of default offset-based
              pagination
            default: false
            title: Enablecursor
          description: >-
            Enable cursor based pagination instead of default offset-based
            pagination
        - name: updatedSince
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Datetime filter, only return items updated since this datetime.
              Example format: `2021-01-01T00:00:00+00:00`
            title: Updatedsince
          description: >-
            Datetime filter, only return items updated since this datetime.
            Example format: `2021-01-01T00:00:00+00:00`
          example: '2021-01-01T00:00:00+00:00'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Limit size (page size)
            default: 100
            title: Limit
          description: Limit size (page size)
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Offset index (starting index of page)
            default: 0
            title: Offset
          description: Offset index (starting index of page)
        - name: excludeTotal
          in: query
          required: false
          schema:
            type: boolean
            description: Skips returning the total rows, total is set to null when true
            default: false
            title: Excludetotal
          description: Skips returning the total rows, total is set to null when true
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Skip token to continue from the last item in the previous page
            title: Cursor
          description: Skip token to continue from the last item in the previous page
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: >-
                      #/components/schemas/OffsetPaginatedResponse_ScopedIDPPolicyRespModel_
                  - $ref: >-
                      #/components/schemas/KeySetPaginatedResponse_ScopedIDPPolicyRespModel_
                title: Response List Idp Policies
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorException'
          description: Internal Server Error
      security:
        - Connection-ID: []
          API-Key: []
components:
  schemas:
    OffsetPaginatedResponse_ScopedIDPPolicyRespModel_:
      properties:
        count:
          type: integer
          title: Count
          description: Number of items return in the response
        total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total
          description: Total number of items that can be returned
        items:
          items:
            $ref: '#/components/schemas/ScopedIDPPolicyRespModel'
          type: array
          title: Items
          description: List of items returned in the response
      type: object
      required:
        - count
        - items
      title: OffsetPaginatedResponse[ScopedIDPPolicyRespModel]
    KeySetPaginatedResponse_ScopedIDPPolicyRespModel_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ScopedIDPPolicyRespModel'
          type: array
          title: Items
          description: List of items returned in the response
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Skip token to continue from the last item in the previous page
        previous_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Cursor
          description: Skip token to continue from the first item in the previous page
      type: object
      required:
        - items
      title: KeySetPaginatedResponse[ScopedIDPPolicyRespModel]
    ErrorResponse:
      properties:
        type:
          type: string
          title: Type
          description: Type of error
        code:
          type: string
          title: Code
          description: Error code
        message:
          type: string
          title: Message
          description: Error message
        detail:
          items:
            type: object
          type: array
          title: Detail
          description: List of error dictionaries
      type: object
      required:
        - type
        - code
        - message
        - detail
      title: ErrorResponse
    ErrorException:
      properties:
        detail:
          type: string
          title: Detail
          description: Error message
      type: object
      required:
        - detail
      title: ErrorException
    ScopedIDPPolicyRespModel:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: ID of the policy
        vendor_id:
          type: string
          title: Vendor Id
          description: Vendor's ID of the policy
        name:
          type: string
          title: Name
          description: Name of the policy
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the policy
        type:
          type: string
          title: Type
          description: Type of the policy
        status:
          type: string
          title: Status
          description: Status of the policy
        priority:
          anyOf:
            - type: integer
            - type: 'null'
          title: Priority
          description: Priority of the policy
        last_updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Updated At
          description: Last updated at of the policy
        vendor_created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Vendor Created At
          description: Vendor's created at of the policy
        configuration:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/PolicyPasswordSettingsRespModel'
                - $ref: '#/components/schemas/PolicyMFASettingsRespModel'
                - $ref: >-
                    #/components/schemas/PolicyConditionalAccessSettingsRespModel
                - $ref: '#/components/schemas/PolicyAuthenticationSettingsRespModel'
                - $ref: '#/components/schemas/PolicyRiskBasedSettingsRespModel'
                - $ref: >-
                    #/components/schemas/PolicyCrossTenantAccessSettingsRespModel
                - $ref: '#/components/schemas/PolicyAuthorizationSettingsRespModel'
              discriminator:
                propertyName: type
                mapping:
                  AUTHENTICATION:
                    $ref: '#/components/schemas/PolicyAuthenticationSettingsRespModel'
                  AUTHORIZATION:
                    $ref: '#/components/schemas/PolicyAuthorizationSettingsRespModel'
                  CONDITIONAL_ACCESS:
                    $ref: >-
                      #/components/schemas/PolicyConditionalAccessSettingsRespModel
                  CROSS_TENANT_ACCESS:
                    $ref: >-
                      #/components/schemas/PolicyCrossTenantAccessSettingsRespModel
                  MFA:
                    $ref: '#/components/schemas/PolicyMFASettingsRespModel'
                  PASSWORD:
                    $ref: '#/components/schemas/PolicyPasswordSettingsRespModel'
                  RISK_BASED:
                    $ref: '#/components/schemas/PolicyRiskBasedSettingsRespModel'
            - type: 'null'
          title: Configuration
          description: Policy-specific configuration
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Is policy deleted
      type: object
      required:
        - id
        - vendor_id
        - name
        - type
        - status
        - is_deleted
      title: ScopedIDPPolicyRespModel
    PolicyPasswordSettingsRespModel:
      properties:
        type:
          type: string
          enum:
            - PASSWORD
          const: PASSWORD
          title: Type
          default: PASSWORD
        min_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Length
        max_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Length
        min_lowercase:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Lowercase
        min_uppercase:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Uppercase
        min_numbers:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Numbers
        min_symbols:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Symbols
        password_history:
          anyOf:
            - type: integer
            - type: 'null'
          title: Password History
        max_age_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Age Days
        min_age_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Age Days
        lockout_threshold:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lockout Threshold
        lockout_duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lockout Duration Minutes
        complexity_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Complexity Required
        dictionary_check:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Dictionary Check
        common_password_check:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Common Password Check
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      title: PolicyPasswordSettingsRespModel
      description: Password policy settings for API responses
    PolicyMFASettingsRespModel:
      properties:
        type:
          type: string
          enum:
            - MFA
          const: MFA
          title: Type
          default: MFA
        enrollment_policy:
          anyOf:
            - type: string
            - type: 'null'
          title: Enrollment Policy
        self_service_enrollment:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Self Service Enrollment
        registration_campaigns:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Registration Campaigns
        supported_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Supported Methods
        required_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Required Methods
        backup_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Backup Methods
        factor_sequencing:
          anyOf:
            - type: string
            - type: 'null'
          title: Factor Sequencing
        remember_device:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Remember Device
        remember_device_duration_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Remember Device Duration Days
        session_frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Frequency
        risk_based_prompts:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Risk Based Prompts
        hardware_tokens_allowed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Hardware Tokens Allowed
        adaptive_mfa_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Adaptive Mfa Enabled
        step_up_authentication:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Step Up Authentication
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      title: PolicyMFASettingsRespModel
      description: MFA policy settings for API responses
    PolicyConditionalAccessSettingsRespModel:
      properties:
        type:
          type: string
          enum:
            - CONDITIONAL_ACCESS
          const: CONDITIONAL_ACCESS
          title: Type
          default: CONDITIONAL_ACCESS
        named_locations:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Named Locations
        trusted_locations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Trusted Locations
        network_zones:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Network Zones
        ip_ranges_allowed:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Ip Ranges Allowed
        ip_ranges_blocked:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Ip Ranges Blocked
        countries_allowed:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Countries Allowed
        countries_blocked:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Countries Blocked
        device_platforms:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Device Platforms
        device_states:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Device States
        client_apps:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Client Apps
        sign_in_risk_levels:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Sign In Risk Levels
        user_risk_levels:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: User Risk Levels
        grant_controls:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Grant Controls
        session_controls:
          anyOf:
            - type: object
            - type: 'null'
          title: Session Controls
        conditions:
          anyOf:
            - type: object
            - type: 'null'
          title: Conditions
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      title: PolicyConditionalAccessSettingsRespModel
      description: Conditional Access policy settings for API responses
    PolicyAuthenticationSettingsRespModel:
      properties:
        type:
          type: string
          enum:
            - AUTHENTICATION
          const: AUTHENTICATION
          title: Type
          default: AUTHENTICATION
        primary_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Primary Methods
        passwordless_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Passwordless Enabled
        certificate_based_auth:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Certificate Based Auth
        secondary_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Secondary Methods
        sso_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Sso Enabled
        federated_auth:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Federated Auth
        authentication_strength:
          anyOf:
            - type: string
            - type: 'null'
          title: Authentication Strength
        identity_providers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Identity Providers
        custom_auth_providers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Custom Auth Providers
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      title: PolicyAuthenticationSettingsRespModel
      description: Authentication policy settings for API responses
    PolicyRiskBasedSettingsRespModel:
      properties:
        type:
          type: string
          enum:
            - RISK_BASED
          const: RISK_BASED
          title: Type
          default: RISK_BASED
        ml_risk_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ml Risk Detection
        behavior_analytics:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Behavior Analytics
        impossible_travel_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Impossible Travel Detection
        anonymous_ip_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Anonymous Ip Detection
        malware_linked_ip_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Malware Linked Ip Detection
        risk_score_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Risk Score Threshold
        user_risk_threshold:
          anyOf:
            - type: string
            - type: 'null'
          title: User Risk Threshold
        sign_in_risk_threshold:
          anyOf:
            - type: string
            - type: 'null'
          title: Sign In Risk Threshold
        anomaly_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Anomaly Detection
        real_time_monitoring:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Real Time Monitoring
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      title: PolicyRiskBasedSettingsRespModel
      description: Risk-based policy settings for API responses
    PolicyCrossTenantAccessSettingsRespModel:
      properties:
        type:
          type: string
          enum:
            - CROSS_TENANT_ACCESS
          const: CROSS_TENANT_ACCESS
          title: Type
          default: CROSS_TENANT_ACCESS
        allowed_organizations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Organizations
        blocked_organizations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Blocked Organizations
        trusted_organizations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Trusted Organizations
        guest_access_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Guest Access Enabled
        external_user_invitation_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: External User Invitation Enabled
        cross_tenant_sync_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Cross Tenant Sync Enabled
        b2b_collaboration_settings:
          anyOf:
            - type: object
            - type: 'null'
          title: B2B Collaboration Settings
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      title: PolicyCrossTenantAccessSettingsRespModel
      description: Cross-tenant access policy settings for API responses
    PolicyAuthorizationSettingsRespModel:
      properties:
        type:
          type: string
          enum:
            - AUTHORIZATION
          const: AUTHORIZATION
          title: Type
          default: AUTHORIZATION
        rbac_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Rbac Enabled
        role_assignments:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Role Assignments
        role_inheritance_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Role Inheritance Enabled
        abac_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Abac Enabled
        attribute_requirements:
          anyOf:
            - type: object
            - type: 'null'
          title: Attribute Requirements
        dynamic_authorization:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Dynamic Authorization
        permission_sets:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Permission Sets
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      title: PolicyAuthorizationSettingsRespModel
      description: Authorization policy settings for API responses
  securitySchemes:
    Connection-ID:
      type: apiKey
      in: header
      name: X-CONNECTION-ID
    API-Key:
      type: apiKey
      in: header
      name: X-API-KEY

````