> ## 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.

# List deployments for an environment

> List deployments for a single environment within a time range, newest first.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /environments/{org}/{env_name}/deployments
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:
  /environments/{org}/{env_name}/deployments:
    get:
      tags:
        - Environments
      summary: List deployments for an environment
      description: >-
        List deployments for a single environment within a time range, newest
        first.
      operationId: list_env_deployments
      parameters:
        - name: env_name
          in: path
          required: true
          schema:
            type: string
            title: Env Name
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Start of time range, ISO-8601 (Default: 30 days ago)'
            title: From
          description: 'Start of time range, ISO-8601 (Default: 30 days ago)'
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'End of time range, ISO-8601 (Default: now)'
            title: To
          description: 'End of time range, ISO-8601 (Default: now)'
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page
          description: Page number
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Deployments per page
            default: 50
            title: Page Size
          description: Deployments per page
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvDeploymentListResponse'
        '400':
          description: Invalid data range
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__3
        '404':
          description: Environment Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__30
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    EnvDeploymentListResponse:
      properties:
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
        page:
          type: integer
          title: Page
        per_page:
          type: integer
          title: Per Page
        total_pages:
          type: integer
          title: Total Pages
        total_count:
          type: integer
          title: Total Count
        deployments:
          items:
            $ref: '#/components/schemas/EnvDeploymentListItemResponse'
          type: array
          title: Deployments
      additionalProperties: false
      type: object
      required:
        - page
        - per_page
        - total_pages
        - total_count
        - deployments
      title: EnvDeploymentListResponse
    fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__3:
      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: BadRequestResponseModel
      examples:
        - message: Input payload validation failed
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__30:
      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: Environment not found
      examples:
        - message: Environment not found
    EnvDeploymentListItemResponse:
      properties:
        fingerprint:
          type: string
          title: Fingerprint
        artifact_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Artifact Name
        compliance:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Compliance
        env_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Env Name
        snapshot_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Snapshot Index
        deployed_at:
          type: number
          title: Deployed At
        commit:
          anyOf:
            - $ref: '#/components/schemas/GitCommitInfo'
            - type: 'null'
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
      type: object
      required:
        - fingerprint
        - deployed_at
      title: EnvDeploymentListItemResponse
    GitCommitInfo:
      properties:
        sha1:
          type: string
          title: Sha1
          description: The SHA-1 hash of the commit
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: The commit message
        author:
          anyOf:
            - type: string
            - type: 'null'
          title: Author
          description: The commit author
        branch:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch
          description: The branch name
        timestamp:
          anyOf:
            - type: number
            - type: 'null'
          title: Timestamp
          description: The commit timestamp
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: The commit URL
      type: object
      required:
        - sha1
      title: GitCommitInfo
      description: |-
        Git commit information response model.

        Excludes author_username, parents, and url from JSON when not present.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````