> ## 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 Compliance Data with Conditional Findings

> Retrieve compliance frameworks and their controls, each with the findings that determine whether the control passes.



## OpenAPI

````yaml get /cspm/compliance
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:
  /cspm/compliance:
    get:
      tags:
        - cspm
      summary: List Compliance Data with Conditional Findings
      description: >-
        Retrieve compliance frameworks and their controls, each with the
        findings that determine whether the control passes.
      operationId: get_cspm_compliance_data
      parameters:
        - description: >-
            Only controls whose `updated_at` is at or after this time. Leen
            bumps `updated_at` whenever any field changes, so this is the
            incremental-sync filter. 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 controls whose `updated_at` is at or after this time. Leen
              bumps `updated_at` whenever any field changes, so this is the
              incremental-sync filter. Example: `2021-01-01T00:00:00+00:00`.
            examples:
              - '2021-01-01T00:00:00+00:00'
            title: Updatedsince
        - 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
        - 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: Include findings data (only for FAIL status compliances)
          in: query
          name: includeFindings
          required: false
          schema:
            default: false
            description: Include findings data (only for FAIL status compliances)
            title: Includefindings
            type: boolean
        - description: >-
            Filter by one or more compliance status. Valid values: PASS, FAIL,
            NOT_APPLICABLE, DELETED
          in: query
          name: complianceStatus
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by one or more compliance status. Valid values: PASS, FAIL,
              NOT_APPLICABLE, DELETED
            examples:
              - PASS, FAIL
            title: Compliancestatus
        - description: Filter by one or more standard (partial match, case insensitive)
          in: query
          name: standard
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by one or more standard (partial match, case insensitive)
            examples:
              - AWS Best Practices, CIS
            title: Standard
        - description: >-
            Include the rules each control cites, with the counts the tool
            publishes for each, as `rules`. With `includeFindings`, each finding
            also names the rule it failed.
          in: query
          name: includeRules
          required: false
          schema:
            default: false
            description: >-
              Include the rules each control cites, with the counts the tool
              publishes for each, as `rules`. With `includeFindings`, each
              finding also names the rule it failed.
            title: Includerules
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/KeySetPaginatedResponse_CSPMComplianceDataRespModel_
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
      security:
        - API-Key: []
          Connection-ID: []
components:
  schemas:
    KeySetPaginatedResponse_CSPMComplianceDataRespModel_:
      properties:
        items:
          description: The records on this page.
          items:
            $ref: '#/components/schemas/CSPMComplianceDataRespModel'
          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[CSPMComplianceDataRespModel]
      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
    CSPMComplianceDataRespModel:
      description: Compliance-centric response model with conditional findings
      properties:
        control:
          description: The control being evaluated, as the standard names it.
          title: Control
          type: string
        findings:
          anyOf:
            - items:
                $ref: >-
                  #/components/schemas/CSPMComplianceFindingForComplianceRespModel
              type: array
            - type: 'null'
          description: >-
            The failing findings behind this control. Present only when the
            request asked for them and the control is failing.
          title: Findings
        id:
          description: Leen's identifier for this control result.
          format: uuid
          title: Id
          type: string
        is_enabled:
          description: >-
            Whether the control is switched on in the tool. A disabled control
            is reported rather than hidden, so its absence from results is
            distinguishable from it passing.
          title: Is Enabled
          type: boolean
        requirements:
          description: Requirements within the standard that this control satisfies.
          items:
            type: string
          title: Requirements
          type: array
        rule_counts:
          anyOf:
            - $ref: '#/components/schemas/CSPMRuleCountsRespModel'
            - type: 'null'
          description: >-
            How many of `rules` pass, fail or do not apply: a count of rules,
            where each rule's own counts are of resources. Present only when the
            request sets `includeRules`. For Microsoft Defender for Cloud, the
            control's `vendor_data.passed_resources`, `failed_resources` and
            `skipped_resources` are the tool's own counts of the same thing,
            rules (assessments) under the control rather than resources,
            whatever their names say.
        rules:
          anyOf:
            - items:
                $ref: '#/components/schemas/CSPMRuleForComplianceRespModel'
              type: array
            - type: 'null'
          description: >-
            The rules this control cites, each with the counts the tool
            publishes for it under this control. Present only when the request
            sets `includeRules`.
          title: Rules
        standard:
          description: >-
            The compliance standard the control belongs to, e.g. `CIS`,
            `PCI-DSS`.
          title: Standard
          type: string
        status:
          description: >-
            Status, normalised across tools. For the tool's own wording see
            `vendor_status`.
          title: Status
          type: string
        status_changed_at:
          description: When `status` last changed.
          format: date-time
          title: Status Changed At
          type: string
        vendor:
          description: Connector that produced this result.
          title: Vendor
          type: string
        vendor_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Vendor specific pass through data, values can vary based on vendor
          title: Vendor Data
        vendor_id:
          description: The tool's own identifier for the control.
          title: Vendor Id
          type: string
        vendor_status:
          description: Status exactly as the tool words it.
          title: Vendor Status
          type: string
      required:
        - id
        - vendor_id
        - vendor
        - control
        - standard
        - requirements
        - status
        - vendor_status
        - is_enabled
        - status_changed_at
      title: CSPMComplianceData
      type: object
    CSPMComplianceFindingForComplianceRespModel:
      description: Simplified finding model for inclusion in compliance responses
      properties:
        description:
          description: What the check looked for and what it found.
          title: Description
          type: string
        id:
          description: Leen's identifier for this finding.
          format: uuid
          title: Id
          type: string
        remediation:
          description: How the tool says to fix it.
          title: Remediation
          type: string
        resource_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The cloud resource this finding is about, by the provider's id.
          title: Resource Id
        resource_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Human-readable name of the resource, where the provider has one.
          title: Resource Name
        resource_region:
          anyOf:
            - type: string
            - type: 'null'
          description: Provider region the resource lives in.
          title: Resource Region
        resource_type:
          anyOf:
            - type: string
            - type: 'null'
          description: What kind of resource it is, as the provider names it.
          title: Resource Type
        rule:
          anyOf:
            - $ref: '#/components/schemas/CSPMRuleRefRespModel'
            - type: 'null'
          description: >-
            The rule this finding failed. Present only when the request sets
            `includeRules`; null when the tool names no rule for the finding.
        severity:
          description: >-
            Severity, normalised across tools so it can be compared and
            filtered. For the tool's own wording see `vendor_severity`.
          title: Severity
          type: string
        start_time:
          description: When the tool first raised this finding.
          format: date-time
          title: Start Time
          type: string
        status:
          description: >-
            Status, normalised across tools. For the tool's own wording see
            `vendor_status`.
          title: Status
          type: string
        status_changed_at:
          description: >-
            When `status` last changed -- when it passed, failed, or was
            suppressed.
          format: date-time
          title: Status Changed At
          type: string
        title:
          description: Finding title, as the tool states it.
          title: Title
          type: string
        vendor_id:
          description: The tool's own identifier for the finding.
          title: Vendor Id
          type: string
        vendor_severity:
          description: >-
            Severity exactly as the tool words it. Not comparable across tools
            -- one vendor's confidence level is another's numeric score -- but
            it is what their console shows.
          title: Vendor Severity
          type: string
        vendor_status:
          description: Status exactly as the tool words it.
          title: Vendor Status
          type: string
      required:
        - id
        - vendor_id
        - title
        - description
        - remediation
        - status
        - vendor_status
        - severity
        - vendor_severity
        - start_time
        - status_changed_at
      title: CSPMComplianceFindingForCompliance
      type: object
    CSPMRuleCountsRespModel:
      description: >-
        A control's rules counted by their state under it: rules, not resources.


        The four buckets partition the rules, so `passed + failed +
        not_applicable + unknown`

        always equals `total`. `unknown` exists to make that true: a citation
        whose state the tool

        did not publish is a real and common case, and without a bucket of its
        own it would be a

        silent gap between `total` and the three named states.
      properties:
        failed:
          description: Rules whose `state` under this control is `FAIL`.
          minimum: 0
          title: Failed
          type: integer
        not_applicable:
          description: >-
            Rules whose `state` under this control is `NOT_APPLICABLE`: skipped,
            or unable to evaluate the control's resources.
          minimum: 0
          title: Not Applicable
          type: integer
        passed:
          description: Rules whose `state` under this control is `PASS`.
          minimum: 0
          title: Passed
          type: integer
        total:
          description: >-
            Rules this control cites. Equal to `passed` + `failed` +
            `not_applicable` + `unknown`.
          minimum: 0
          title: Total
          type: integer
        unknown:
          description: >-
            Rules with no `state` under this control: the tool published none.
            Counted separately so the other three plus this one always sum to
            `total`.
          minimum: 0
          title: Unknown
          type: integer
      required:
        - total
        - passed
        - failed
        - not_applicable
        - unknown
      title: CSPMRuleCounts
      type: object
    CSPMRuleForComplianceRespModel:
      description: >-
        A rule as one control cites it, with the counts the tool publishes for
        it there.
      properties:
        description:
          description: >-
            What the rule checks, as the tool describes it. Empty when the tool
            publishes no description.
          title: Description
          type: string
        failed_resources:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Resources that fail this rule under this control, as the tool counts
            them. Null when the tool publishes no count.
          title: Failed Resources
        id:
          description: Leen's identifier for this rule.
          format: uuid
          title: Id
          type: string
        logic_language:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The language of the rule's logic where the tool exposes it:
            `AZURE_POLICY_JSON`, `REGO`, `LQL` or `WIZ_GRAPH_QUERY`.
          title: Logic Language
        name:
          description: The criterion, as the tool states it.
          title: Name
          type: string
        passed_resources:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Resources that pass this rule under this control, as the tool counts
            them. Null when the tool publishes no count.
          title: Passed Resources
        remediation:
          description: >-
            How the tool says to fix a resource that fails this rule. Empty when
            the tool publishes none.
          title: Remediation
          type: string
        rule_kind:
          description: >-
            The tool's own classification of the rule -- for Microsoft Defender
            for Cloud the assessment type, which says whether policy logic sits
            behind it. Empty when the tool publishes none.
          title: Rule Kind
          type: string
        severity:
          description: >-
            Severity, normalised across tools. `NONE` when the tool does not
            rate the rule.
          title: Severity
          type: string
        skipped_resources:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Resources the tool skipped for this rule under this control. Null
            when the tool publishes no count.
          title: Skipped Resources
        state:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Whether this rule passes under this control, normalised across
            tools.
          title: State
        unsupported_resources:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Resources this rule cannot evaluate under this control. Null when
            the tool publishes no count.
          title: Unsupported Resources
        vendor_id:
          description: The tool's own identifier for the rule.
          title: Vendor Id
          type: string
      required:
        - id
        - vendor_id
        - name
        - description
        - remediation
        - severity
        - rule_kind
      title: CSPMRuleForCompliance
      type: object
    CSPMRuleRefRespModel:
      properties:
        id:
          description: Leen's identifier for this rule.
          format: uuid
          title: Id
          type: string
        name:
          description: The criterion, as the tool states it.
          title: Name
          type: string
        vendor_id:
          description: The tool's own identifier for the rule.
          title: Vendor Id
          type: string
      required:
        - id
        - vendor_id
        - name
      title: CSPMRuleRef
      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.