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

# Deployment frequency and lead-time statistics for a repo

> Per-environment deployment-frequency and lead-time series for a repo,
identified by its internal `id` (the `{repo}` path segment).

Returns one entry per non-logical environment the repo has been deployed to
(respecting the env filter), each with its raw `deployed_at` and
`lead_time_seconds` series plus the shared window bounds. Daily bucketing,
median and percentiles are computed client-side.

- end_ts defaults to now.
- start_ts defaults to 28 days before end_ts.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /repos/{org}/{repo}/deployment-statistics
openapi: 3.1.0
info:
  title: Kosli API
  summary: The API for communicating with Kosli
  description: >

    # Authentication 


    When making requests against Kosli API, you can authenticate your requests
    using a bearer token. 

    Set the bearer token in the request Authorization header to a valid API
    key. 

    API Keys can be personal or for service accounts. Check the [service
    accounts
    documentation](https://docs.kosli.com/getting_started/service-accounts/) for
    details. 


    ## Curl example


    ```shell

    curl -H "Authorization: Bearer <<your-api-key>>"
    https://app.kosli.com/api/v2/environments/<<your-org-name>>

    ```
  version: '2.0'
servers:
  - url: https://app.kosli.com/api/v2
    description: EU
  - url: https://app.us.kosli.com/api/v2
    description: US
security:
  - HTTPBearer: []
paths:
  /repos/{org}/{repo}/deployment-statistics:
    get:
      tags:
        - Repos
      summary: Deployment frequency and lead-time statistics for a repo
      description: >-
        Per-environment deployment-frequency and lead-time series for a repo,

        identified by its internal `id` (the `{repo}` path segment).


        Returns one entry per non-logical environment the repo has been deployed
        to

        (respecting the env filter), each with its raw `deployed_at` and

        `lead_time_seconds` series plus the shared window bounds. Daily
        bucketing,

        median and percentiles are computed client-side.


        - end_ts defaults to now.

        - start_ts defaults to 28 days before end_ts.
      operationId: get_repo_deployment_statistics
      parameters:
        - name: repo
          in: path
          required: true
          schema:
            type: string
            title: Repo
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: env
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
            description: >-
              Filter by environment name. Repeat to select several; omit for all
              environments the repo has been deployed to.
            default: []
            title: Env
          description: >-
            Filter by environment name. Repeat to select several; omit for all
            environments the repo has been deployed to.
        - name: start_ts
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: >-
              Include deployments at or after this timestamp. Defaults to 28
              days before end_ts
            title: Start Ts
          description: >-
            Include deployments at or after this timestamp. Defaults to 28 days
            before end_ts
        - name: end_ts
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: Include deployments at or before this timestamp. Defaults to now
            title: End Ts
          description: Include deployments at or before this timestamp. Defaults to now
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentStatisticsResponse'
        '404':
          description: Resource Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__42
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    DeploymentStatisticsResponse:
      properties:
        start_ts:
          type: number
          title: Start Ts
        end_ts:
          type: number
          title: End Ts
        environments:
          items:
            $ref: '#/components/schemas/EnvDeploymentStatisticsItem'
          type: array
          title: Environments
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
      type: object
      required:
        - start_ts
        - end_ts
        - environments
      title: DeploymentStatisticsResponse
      description: >-
        Per-environment deployment-frequency + lead-time series for a repo.


        Returns one entry per environment the repo has been deployed to
        (respecting

        the env filter), each carrying its raw `deployed_at` and
        `lead_time_seconds`

        series plus the shared window bounds. One round trip replaces the
        current

        per-card lazy-load.
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__42:
      properties:
        message:
          type: string
          title: Message
          description: Error message
        errors:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Errors
          description: Validation errors by field
      type: object
      required:
        - message
      title: NotFoundResponseModel
      description: Repo not found
      examples:
        - message: Repo not found
    EnvDeploymentStatisticsItem:
      properties:
        env_name:
          type: string
          title: Env Name
        deployment_frequency:
          items:
            $ref: '#/components/schemas/DeploymentFrequencyItem'
          type: array
          title: Deployment Frequency
        lead_times:
          items:
            $ref: '#/components/schemas/DeploymentLeadTimeItem'
          type: array
          title: Lead Times
      type: object
      required:
        - env_name
        - deployment_frequency
        - lead_times
      title: EnvDeploymentStatisticsItem
    DeploymentFrequencyItem:
      properties:
        deployed_at:
          type: number
          title: Deployed At
      type: object
      required:
        - deployed_at
      title: DeploymentFrequencyItem
    DeploymentLeadTimeItem:
      properties:
        lead_time_seconds:
          type: number
          title: Lead Time Seconds
      type: object
      required:
        - lead_time_seconds
      title: DeploymentLeadTimeItem
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````