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

# Get compliance trend

> Requires `detection.read`. Results are scoped to the authenticated tenant. This reference is generated from source; consult the authenticated live schema for deployment-specific availability.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/organizations/{organization_id}/compliance/trend
openapi: 3.1.0
info:
  title: Alignr API
  version: 0.1.0
  description: >-
    Selected read operations. Generated from the Alignr application; no tenant
    data is included.
servers:
  - url: https://api.alignr.io
security: []
paths:
  /api/v1/organizations/{organization_id}/compliance/trend:
    get:
      tags:
        - Alignment
      summary: Get compliance trend
      description: >-
        Requires `detection.read`. Results are scoped to the authenticated
        tenant. This reference is generated from source; consult the
        authenticated live schema for deployment-specific availability.
      operationId: >-
        get_organization_compliance_trend_api_v1_organizations__organization_id__compliance_trend_get
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Organization Id
        - name: windowDays
          in: query
          required: false
          schema:
            type: integer
            maximum: 366
            minimum: 1
            description: How many days of trend to return
            default: 90
            title: Windowdays
          description: How many days of trend to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComplianceTrendRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    ComplianceTrendRead:
      properties:
        organizationId:
          type: string
          format: uuid
          title: Organizationid
        organizationName:
          type: string
          title: Organizationname
        windowDays:
          type: integer
          title: Windowdays
        buckets:
          items:
            $ref: '#/components/schemas/TrendBucketRead'
          type: array
          title: Buckets
      type: object
      required:
        - organizationId
        - organizationName
        - windowDays
        - buckets
      title: ComplianceTrendRead
      description: >-
        `GET /organizations/{orgId}/compliance/trend` — how this organisation's

        five-status rollup moved over `windowDays` UTC calendar days ending
        today.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TrendBucketRead:
      properties:
        day:
          type: string
          format: date
          title: Day
        passCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Passcount
        failCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Failcount
        noDataCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Nodatacount
        notCoveredCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Notcoveredcount
        notApplicableCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Notapplicablecount
      type: object
      required:
        - day
      title: TrendBucketRead
      description: >-
        One UTC calendar day of `GET /organizations/{orgId}/compliance/trend` —

        the wire shape of `control_evaluation_service.TrendBucket`.


        A **gap** day (`control_evaluation_service.status_trend` recorded zero

        evaluations for it) carries every count as `null`, never `0` — see

        `TrendBucket`'s own docstring. A day that genuinely had evaluations
        always

        carries all five counts, including any that are legitimately zero. The
        two

        must stay distinguishable on the wire exactly as they must in the
        service:

        a UI that defaults a missing count to `0` before checking for `null`
        would

        silently repaint "nobody swept this client that day" as "a clean bill of

        health that day", which is precisely the failure spec §5's `not_covered`

        exists to rule out one step earlier in the pipeline.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: An Alignr API key.

````