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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.kosli.com/feedback

```json
{
  "path": "/api-reference/envdiff/get-environment-diff",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Get environment diff

> Get diff between to snapshots



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /env-diff/{org}
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:
  /env-diff/{org}:
    get:
      tags:
        - EnvDiff
      summary: Get environment diff
      description: Get diff between to snapshots
      operationId: environment_diff_env_diff__org__get
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: snappish1
          in: query
          required: true
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: |-
              Expression to specify the snapshot 1 for comparison.
              Must contain environment name.
              Add '#N' to specify exact snapshot number N.
              Add '~N' to get N-th behind the latest snapshot.
              Examples: staging, staging#10, staging~2
            title: Snappish1
          description: |-
            Expression to specify the snapshot 1 for comparison.
            Must contain environment name.
            Add '#N' to specify exact snapshot number N.
            Add '~N' to get N-th behind the latest snapshot.
            Examples: staging, staging#10, staging~2
        - name: snappish2
          in: query
          required: true
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: |-
              Expression to specify the snapshot 2 for comparison.
              Must contain environment name.
              Add '#N' to specify exact snapshot number N.
              'Add '~N' to get N-th behind the latest snapshot.
              Examples: staging, staging#10, staging~2
            title: Snappish2
          description: |-
            Expression to specify the snapshot 2 for comparison.
            Must contain environment name.
            Add '#N' to specify exact snapshot number N.
            'Add '~N' to get N-th behind the latest snapshot.
            Examples: staging, staging#10, staging~2
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentDiffResponse'
        '404':
          description: Not found
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    EnvironmentDiffResponse:
      properties:
        snappish1:
          $ref: '#/components/schemas/DiffItem'
        snappish2:
          $ref: '#/components/schemas/DiffItem'
        changed:
          $ref: '#/components/schemas/DiffItem'
        not-changed:
          $ref: '#/components/schemas/DiffItem'
      type: object
      required:
        - snappish1
        - snappish2
        - changed
        - not-changed
      title: EnvironmentDiffResponse
    DiffItem:
      properties:
        snapshot_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Snapshot Id
        artifacts:
          items:
            $ref: '#/components/schemas/ArtifactInfo'
          type: array
          title: Artifacts
      type: object
      required:
        - artifacts
      title: DiffItem
    ArtifactInfo:
      properties:
        fingerprint:
          anyOf:
            - type: string
              pattern: ^[a-f0-9]{64}$
            - type: string
              const: ''
          title: Fingerprint
        name:
          type: string
          title: Name
        most_recent_timestamp:
          type: integer
          title: Most Recent Timestamp
        flow:
          type: string
          title: Flow
        commit_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Commit Url
        instance_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Instance Count
        s1_instance_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: S1 Instance Count
        s2_instance_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: S2 Instance Count
        pods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Pods
      type: object
      required:
        - fingerprint
        - name
        - most_recent_timestamp
        - flow
      title: ArtifactInfo
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````