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

# Get security posture



## OpenAPI

````yaml https://zeropath.com/openapi/v1.yaml post /api/v1/stats/securityPosture
openapi: 3.1.0
info:
  title: ZeroPath API
  version: 1.0.0
  description: Public API for ZeroPath
servers:
  - url: https://zeropath.com
    description: Production server
    x-fern-server-name: Production
  - url: https://dev.branch.zeropath.com
    description: Development server
    x-fern-server-name: Development
security:
  - apiTokenId: []
    apiTokenSecret: []
tags:
  - name: Organizations
    description: Operations related to organizations
  - name: Stats
    description: Operations related to stats
  - name: Repositories
    description: Operations related to repositories
  - name: Installations
    description: Operations related to installations
  - name: Issues
    description: Operations related to issues
  - name: SCA
    description: Software Composition Analysis
  - name: Scans
    description: Operations related to scans
  - name: Rules
    description: Operations related to custom security rules
  - name: Referrals
    description: Operations related to referrals
paths:
  /api/v1/stats/securityPosture:
    post:
      tags:
        - Stats
      summary: Get security posture
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                organizationId:
                  type: string
                projectId:
                  type: string
                startDate:
                  type: string
                  format: date
                endDate:
                  type: string
                  format: date
                timeGranularity:
                  type: string
                  enum:
                    - day
                    - week
                    - month
                    - quarter
                severities:
                  type: array
                  items:
                    type: string
                    enum:
                      - critical
                      - high
                      - medium
                      - low
                      - info
                vulnClasses:
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityPostureResponse'
components:
  schemas:
    SecurityPostureResponse:
      type: object
      properties:
        summary:
          type: object
          properties:
            overallRiskScore:
              type: number
            riskTrend:
              type: string
              enum:
                - improving
                - worsening
                - stable
            totalOpenIssues:
              type: number
            criticalIssues:
              type: number
            highIssues:
              type: number
            mediumIssues:
              type: number
            lowIssues:
              type: number
            vulnerabilityDensity:
              type: number
            repositoriesAtRisk:
              type: number
            totalRepositories:
              type: number
            reachableExploitableIssues:
              type: number
            meanRemediationTime:
              type:
                - number
                - 'null'
              description: >-
                Mean days from detection to resolution over the issues resolved
                in the selected range; null when none resolved.
            resolvedIssuesInWindow:
              type: integer
              description: >-
                Number of issues resolved in the selected range: the population
                meanRemediationTime averages. 0 when none resolved.
            averagePrScanTime:
              type: number
          required:
            - overallRiskScore
            - riskTrend
            - totalOpenIssues
            - criticalIssues
            - highIssues
            - mediumIssues
            - lowIssues
            - vulnerabilityDensity
            - repositoriesAtRisk
            - totalRepositories
            - reachableExploitableIssues
            - meanRemediationTime
            - resolvedIssuesInWindow
            - averagePrScanTime
        exposure:
          type: object
          properties:
            meanCriticalExposure:
              type:
                - number
                - 'null'
            meanHighExposure:
              type:
                - number
                - 'null'
            meanMediumExposure:
              type:
                - number
                - 'null'
            meanLowExposure:
              type:
                - number
                - 'null'
            meanInfoExposure:
              type:
                - number
                - 'null'
            oldestCriticalAge:
              type:
                - number
                - 'null'
            oldestHighAge:
              type:
                - number
                - 'null'
            oldestMediumAge:
              type:
                - number
                - 'null'
            oldestLowAge:
              type:
                - number
                - 'null'
            oldestInfoAge:
              type:
                - number
                - 'null'
          required:
            - meanCriticalExposure
            - meanHighExposure
            - meanMediumExposure
            - meanLowExposure
            - meanInfoExposure
            - oldestCriticalAge
            - oldestHighAge
            - oldestMediumAge
            - oldestLowAge
            - oldestInfoAge
        trends:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date
              openIssues:
                type: number
              newIssues:
                type: number
              resolvedIssues:
                type: number
              riskScore:
                type: number
              criticalIssues:
                type: number
              meanRemediationTime:
                type:
                  - number
                  - 'null'
                deprecated: true
                description: >-
                  Deprecated: cumulative mean days to resolve from the range
                  start to this period, so the same date reads differently per
                  range. Will be removed; use meanRemediationTimeInPeriod.
              meanRemediationTimeInPeriod:
                type:
                  - number
                  - 'null'
                description: >-
                  Mean days from detection to resolution over the issues
                  resolved in this period only (resolvedIssues is its sample
                  size); null when none resolved.
              exposure:
                type: object
                properties:
                  meanCriticalExposure:
                    type:
                      - number
                      - 'null'
                  meanHighExposure:
                    type:
                      - number
                      - 'null'
                  meanMediumExposure:
                    type:
                      - number
                      - 'null'
                  meanLowExposure:
                    type:
                      - number
                      - 'null'
                  meanInfoExposure:
                    type:
                      - number
                      - 'null'
                  oldestCriticalAge:
                    type:
                      - number
                      - 'null'
                  oldestHighAge:
                    type:
                      - number
                      - 'null'
                  oldestMediumAge:
                    type:
                      - number
                      - 'null'
                  oldestLowAge:
                    type:
                      - number
                      - 'null'
                  oldestInfoAge:
                    type:
                      - number
                      - 'null'
                required:
                  - meanCriticalExposure
                  - meanHighExposure
                  - meanMediumExposure
                  - meanLowExposure
                  - meanInfoExposure
                  - oldestCriticalAge
                  - oldestHighAge
                  - oldestMediumAge
                  - oldestLowAge
                  - oldestInfoAge
            required:
              - date
              - openIssues
              - newIssues
              - resolvedIssues
              - riskScore
              - criticalIssues
              - meanRemediationTime
              - meanRemediationTimeInPeriod
              - exposure
        topRiskFactors:
          type: array
          items:
            type: object
            properties:
              vulnClass:
                type: string
              count:
                type: number
            required:
              - vulnClass
              - count
        repositoryRiskScores:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              riskScore:
                type: number
              openIssues:
                type: number
              criticalIssues:
                type: number
              highIssues:
                type: number
              mediumIssues:
                type: number
              lowIssues:
                type: number
              infoIssues:
                type: number
            required:
              - id
              - name
              - riskScore
              - openIssues
              - criticalIssues
              - highIssues
              - mediumIssues
              - lowIssues
              - infoIssues
      required:
        - summary
        - exposure
        - trends
        - topRiskFactors
        - repositoryRiskScores
  securitySchemes:
    apiTokenId:
      type: apiKey
      in: header
      name: X-ZeroPath-API-Token-Id
      x-fern-header:
        name: apiTokenId
        env: ZEROPATH_API_TOKEN_ID
    apiTokenSecret:
      type: apiKey
      in: header
      name: X-ZeroPath-API-Token-Secret
      x-fern-header:
        name: apiTokenSecret
        env: ZEROPATH_API_TOKEN_SECRET

````