> ## 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:
  - description: Production API (US)
    url: https://api.leen.dev/v1
  - description: Production API (EU)
    url: https://api.eu-c1.leen.dev/v1
  - description: Production API (APAC)
    url: https://api.ap-se2.leen.dev/v1
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:
        - description: >-
            Enable cursor based pagination instead of default offset-based
            pagination
          in: query
          name: enableCursor
          required: false
          schema:
            default: false
            description: >-
              Enable cursor based pagination instead of default offset-based
              pagination
            title: Enablecursor
            type: boolean
        - description: >-
            Only records whose `updated_at` is at or after this time. Leen bumps
            `updated_at` whenever any field on a record changes, so this is the
            filter for an incremental sync: it returns records that are new and
            records that changed, and nothing that has stood still. Example:
            `2021-01-01T00:00:00+00:00`.
          in: query
          name: updatedSince
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: >-
              Only records whose `updated_at` is at or after this time. Leen
              bumps `updated_at` whenever any field on a record changes, so this
              is the filter for an incremental sync: it returns records that are
              new and records that changed, and nothing that has stood still.
              Example: `2021-01-01T00:00:00+00:00`.
            examples:
              - '2021-01-01T00:00:00+00:00'
            title: Updatedsince
        - description: >-
            How many records to return per page. The walk is the same either
            way; a larger page means fewer round trips and more memory per
            response.
          in: query
          name: limit
          required: false
          schema:
            default: 100
            description: >-
              How many records to return per page. The walk is the same either
              way; a larger page means fewer round trips and more memory per
              response.
            maximum: 500
            minimum: 1
            title: Limit
            type: integer
        - description: >-
            Where to start, counted in records. Offset paging is stable only
            while the underlying data is; prefer the cursor for anything
            long-running.
          in: query
          name: offset
          required: false
          schema:
            default: 0
            description: >-
              Where to start, counted in records. Offset paging is stable only
              while the underlying data is; prefer the cursor for anything
              long-running.
            minimum: 0
            title: Offset
            type: integer
        - description: >-
            Skip counting the total. Counting is the expensive half of a large
            query, so set this when you are walking every page anyway and never
            read `total`. `total` comes back null.
          in: query
          name: excludeTotal
          required: false
          schema:
            default: false
            description: >-
              Skip counting the total. Counting is the expensive half of a large
              query, so set this when you are walking every page anyway and
              never read `total`. `total` comes back null.
            title: Excludetotal
            type: boolean
        - description: >-
            Opaque position of the next page, taken from the previous response.
            Ignore its contents; it encodes where the walk had reached.
          in: query
          name: cursor
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque position of the next page, taken from the previous
              response. Ignore its contents; it encodes where the walk had
              reached.
            title: Cursor
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: >-
                      #/components/schemas/OffsetPaginatedResponse_ScopedIDPPolicyRespModel_
                  - $ref: >-
                      #/components/schemas/KeySetPaginatedResponse_ScopedIDPPolicyRespModel_
                title: Response List Idp Policies
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorException'
          description: Internal Server Error
      security:
        - API-Key: []
          Connection-ID: []
components:
  schemas:
    OffsetPaginatedResponse_ScopedIDPPolicyRespModel_:
      properties:
        count:
          description: Number of items return in the response
          title: Count
          type: integer
        items:
          description: The records on this page.
          items:
            $ref: '#/components/schemas/ScopedIDPPolicyRespModel'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: Total number of items that can be returned
          title: Total
      required:
        - count
        - items
      title: OffsetPaginatedResponse[ScopedIDPPolicyRespModel]
      type: object
    KeySetPaginatedResponse_ScopedIDPPolicyRespModel_:
      properties:
        items:
          description: The records on this page.
          items:
            $ref: '#/components/schemas/ScopedIDPPolicyRespModel'
          title: Items
          type: array
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque position of the next page. Pass it back as `cursor` to
            continue; null when this is the last page.
          title: Next Cursor
        previous_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque position of the previous page, for walking backwards. Null on
            the first page.
          title: Previous Cursor
      required:
        - items
      title: KeySetPaginatedResponse[ScopedIDPPolicyRespModel]
      type: object
    ErrorResponse:
      properties:
        code:
          description: Error code
          title: Code
          type: string
        detail:
          description: List of error dictionaries
          items:
            additionalProperties: true
            type: object
          title: Detail
          type: array
        message:
          description: Error message
          title: Message
          type: string
        type:
          description: Type of error
          title: Type
          type: string
      required:
        - type
        - code
        - message
        - detail
      title: ErrorResponse
      type: object
    ErrorException:
      properties:
        detail:
          description: Error message
          title: Detail
          type: string
      required:
        - detail
      title: ErrorException
      type: object
    ScopedIDPPolicyRespModel:
      properties:
        configuration:
          anyOf:
            - discriminator:
                mapping:
                  AUTHENTICATION: '#/components/schemas/PolicyAuthenticationSettingsRespModel'
                  AUTHORIZATION: '#/components/schemas/PolicyAuthorizationSettingsRespModel'
                  CONDITIONAL_ACCESS: >-
                    #/components/schemas/PolicyConditionalAccessSettingsRespModel
                  CROSS_TENANT_ACCESS: >-
                    #/components/schemas/PolicyCrossTenantAccessSettingsRespModel
                  MFA: '#/components/schemas/PolicyMFASettingsRespModel'
                  PASSWORD: '#/components/schemas/PolicyPasswordSettingsRespModel'
                  RISK_BASED: '#/components/schemas/PolicyRiskBasedSettingsRespModel'
                propertyName: type
              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'
            - type: 'null'
          description: Policy-specific configuration
          title: Configuration
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Description of the policy
          title: Description
        id:
          description: ID of the policy
          format: uuid
          title: Id
          type: string
        is_deleted:
          description: Is policy deleted
          title: Is Deleted
          type: boolean
        last_updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Last updated at of the policy
          title: Last Updated At
        name:
          description: Name of the policy
          title: Name
          type: string
        priority:
          anyOf:
            - type: integer
            - type: 'null'
          description: Priority of the policy
          title: Priority
        status:
          description: Status of the policy
          title: Status
          type: string
        type:
          description: Type of the policy
          title: Type
          type: string
        vendor_created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Vendor's created at of the policy
          title: Vendor Created At
        vendor_id:
          description: Vendor's ID of the policy
          title: Vendor Id
          type: string
      required:
        - id
        - vendor_id
        - name
        - type
        - status
        - is_deleted
      title: ScopedIDPPolicyRespModel
      type: object
    PolicyAuthenticationSettingsRespModel:
      description: Authentication policy settings for API responses
      properties:
        authentication_strength:
          anyOf:
            - type: string
            - type: 'null'
          title: Authentication Strength
        certificate_based_auth:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Certificate Based Auth
        custom_auth_providers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Custom Auth Providers
        federated_auth:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Federated Auth
        identity_providers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Identity Providers
        passwordless_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Passwordless Enabled
        primary_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Primary Methods
        secondary_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Secondary Methods
        sso_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Sso Enabled
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        type:
          const: AUTHENTICATION
          default: AUTHENTICATION
          title: Type
          type: string
      title: PolicyAuthenticationSettingsRespModel
      type: object
    PolicyAuthorizationSettingsRespModel:
      description: Authorization policy settings for API responses
      properties:
        abac_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Abac Enabled
        attribute_requirements:
          anyOf:
            - additionalProperties: true
              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
        rbac_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Rbac Enabled
        role_assignments:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Role Assignments
        role_inheritance_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Role Inheritance Enabled
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        type:
          const: AUTHORIZATION
          default: AUTHORIZATION
          title: Type
          type: string
      title: PolicyAuthorizationSettingsRespModel
      type: object
    PolicyConditionalAccessSettingsRespModel:
      description: Conditional Access policy settings for API responses
      properties:
        client_apps:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Client Apps
        conditions:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Conditions
        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
        grant_controls:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Grant Controls
        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
        named_locations:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Named Locations
        network_zones:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Network Zones
        session_controls:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Session Controls
        sign_in_risk_levels:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Sign In Risk Levels
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        trusted_locations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Trusted Locations
        type:
          const: CONDITIONAL_ACCESS
          default: CONDITIONAL_ACCESS
          title: Type
          type: string
        user_risk_levels:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: User Risk Levels
      title: PolicyConditionalAccessSettingsRespModel
      type: object
    PolicyCrossTenantAccessSettingsRespModel:
      description: Cross-tenant access policy settings for API responses
      properties:
        allowed_organizations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Organizations
        b2b_collaboration_settings:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: B2B Collaboration Settings
        blocked_organizations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Blocked Organizations
        cross_tenant_sync_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Cross Tenant Sync Enabled
        external_user_invitation_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: External User Invitation Enabled
        guest_access_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Guest Access Enabled
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        trusted_organizations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Trusted Organizations
        type:
          const: CROSS_TENANT_ACCESS
          default: CROSS_TENANT_ACCESS
          title: Type
          type: string
      title: PolicyCrossTenantAccessSettingsRespModel
      type: object
    PolicyMFASettingsRespModel:
      description: MFA policy settings for API responses
      properties:
        adaptive_mfa_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Adaptive Mfa Enabled
        backup_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Backup Methods
        enrollment_policy:
          anyOf:
            - type: string
            - type: 'null'
          title: Enrollment Policy
        factor_sequencing:
          anyOf:
            - type: string
            - type: 'null'
          title: Factor Sequencing
        hardware_tokens_allowed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Hardware Tokens Allowed
        registration_campaigns:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Registration Campaigns
        remember_device:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Remember Device
        remember_device_duration_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Remember Device Duration Days
        required_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Required Methods
        risk_based_prompts:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Risk Based Prompts
        self_service_enrollment:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Self Service Enrollment
        session_frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Frequency
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        step_up_authentication:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Step Up Authentication
        supported_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Supported Methods
        type:
          const: MFA
          default: MFA
          title: Type
          type: string
      title: PolicyMFASettingsRespModel
      type: object
    PolicyPasswordSettingsRespModel:
      description: Password policy settings for API responses
      properties:
        common_password_check:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Common Password Check
        complexity_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Complexity Required
        dictionary_check:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Dictionary Check
        lockout_duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lockout Duration Minutes
        lockout_threshold:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lockout Threshold
        max_age_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Age Days
        max_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Length
        min_age_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Age Days
        min_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Length
        min_lowercase:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Lowercase
        min_numbers:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Numbers
        min_symbols:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Symbols
        min_uppercase:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Uppercase
        password_history:
          anyOf:
            - type: integer
            - type: 'null'
          title: Password History
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        type:
          const: PASSWORD
          default: PASSWORD
          title: Type
          type: string
      title: PolicyPasswordSettingsRespModel
      type: object
    PolicyRiskBasedSettingsRespModel:
      description: Risk-based policy settings for API responses
      properties:
        anomaly_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Anomaly Detection
        anonymous_ip_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Anonymous Ip Detection
        behavior_analytics:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Behavior Analytics
        impossible_travel_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Impossible Travel Detection
        malware_linked_ip_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Malware Linked Ip Detection
        ml_risk_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ml Risk Detection
        real_time_monitoring:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Real Time Monitoring
        risk_score_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Risk Score Threshold
        sign_in_risk_threshold:
          anyOf:
            - type: string
            - type: 'null'
          title: Sign In Risk Threshold
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        type:
          const: RISK_BASED
          default: RISK_BASED
          title: Type
          type: string
        user_risk_threshold:
          anyOf:
            - type: string
            - type: 'null'
          title: User Risk Threshold
      title: PolicyRiskBasedSettingsRespModel
      type: object
  securitySchemes:
    API-Key:
      in: header
      name: X-API-KEY
      type: apiKey
    Connection-ID:
      in: header
      name: X-CONNECTION-ID
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.