> ## 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/environments/list-environment-events",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# List environment events

> Get events log for an environment.

**Response Headers:**

* `X-Total-Count`: Total number of events available
* `X-Per-Page`: Number of events per page
* `X-Current-Page`: Current page number
* `X-Total-Pages`: Total number of pages
* `Link`: Pagination links (first, prev, next, last) when applicable

**Pagination Links Format:**
```
<url?page=1&per_page=15>; rel="first",
<url?page=2&per_page=15>; rel="prev",
<url?page=4&per_page=15>; rel="next",
<url?page=10&per_page=15>; rel="last"
```

**Note:** The Link header is only included when there are multiple pages.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /environments/{org}/{env_name}/events
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}/events:
    get:
      tags:
        - Environments
      summary: List environment events
      description: >-
        Get events log for an environment.


        **Response Headers:**


        * `X-Total-Count`: Total number of events available

        * `X-Per-Page`: Number of events per page

        * `X-Current-Page`: Current page number

        * `X-Total-Pages`: Total number of pages

        * `Link`: Pagination links (first, prev, next, last) when applicable


        **Pagination Links Format:**

        ```

        <url?page=1&per_page=15>; rel="first",

        <url?page=2&per_page=15>; rel="prev",

        <url?page=4&per_page=15>; rel="next",

        <url?page=10&per_page=15>; rel="last"

        ```


        **Note:** The Link header is only included when there are multiple
        pages.
      operationId: get_env_events_environments__org___env_name__events_get
      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: interval
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Deprecated, use 'start' and 'end' instead. Expression to specify
              the interval of snapshots to query.

              Must be two snapshot expressions separated by '..'

              ie: '5..10', or '~5..NOW'
            deprecated: true
            title: Interval
          description: >-
            Deprecated, use 'start' and 'end' instead. Expression to specify the
            interval of snapshots to query.

            Must be two snapshot expressions separated by '..'

            ie: '5..10', or '~5..NOW'
          deprecated: true
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: The page number of response.
            default: 1
            title: Page
          description: The page number of response.
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: 'How many results to return per page of response. min: 1, max: 100'
            default: 15
            title: Per Page
          description: 'How many results to return per page of response. min: 1, max: 100'
        - name: reverse
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Return results in reverse order. Expected values: True or False.
              Defaults to False.
            default: false
            title: Reverse
          description: >-
            Return results in reverse order. Expected values: True or False.
            Defaults to False.
        - name: repo_name
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Filter events by repo name. Can be repeated for multiple repos,
              e.g. repo_name=repo1&repo_name=repo2
            title: Repo Name
          description: >-
            Filter events by repo name. Can be repeated for multiple repos, e.g.
            repo_name=repo1&repo_name=repo2
        - name: start
          in: query
          required: false
          schema:
            type: string
            description: >-
              The start of the interval to query. Can be a positive snapshot
              index (1, 2, etc.), negative snapshot index (-1 for latest, -2 for
              second latest, etc.), or time reference ['NOW', '1hour', '1h',
              '2days', '30mins'], or an exact unix timestamp (1719638400).
            default: '1'
            title: Start
          description: >-
            The start of the interval to query. Can be a positive snapshot index
            (1, 2, etc.), negative snapshot index (-1 for latest, -2 for second
            latest, etc.), or time reference ['NOW', '1hour', '1h', '2days',
            '30mins'], or an exact unix timestamp (1719638400).
        - name: end
          in: query
          required: false
          schema:
            type: string
            description: >-
              The end of the interval to query. Can be a positive snapshot index
              (1, 2, etc.), negative snapshot index (-1 for latest, -2 for
              second latest, etc.), or time reference ['NOW', '1hour', '1h',
              '2days', '30mins'], or an exact unix timestamp (1719638400).
            default: NOW
            title: End
          description: >-
            The end of the interval to query. Can be a positive snapshot index
            (1, 2, etc.), negative snapshot index (-1 for latest, -2 for second
            latest, etc.), or time reference ['NOW', '1hour', '1h', '2days',
            '30mins'], or an exact unix timestamp (1719638400).
      responses:
        '200':
          description: List of environment events with pagination headers
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetEnvironmentEventResponse'
                title: >-
                  Response Get Env Events Environments  Org   Env Name  Events
                  Get
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    GetEnvironmentEventResponse:
      properties:
        environment_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment Name
          description: Name for the environment
        snapshot_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Snapshot Index
          description: Snapshot index number
        artifact_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Artifact Name
          description: Artifact name
        sha256:
          anyOf:
            - type: string
            - type: 'null'
          title: Sha256
          description: Artifact fingerprint
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Event description
        reported_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Reported At
          description: Event timestamp
        pipeline:
          anyOf:
            - type: string
            - type: 'null'
          title: Pipeline
          description: 'Deprecated: Pipeline name. Use flows instead.'
        deployments:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Deployments
          description: 'Deprecated: List of deployment ids for the artifact'
        flows:
          anyOf:
            - items:
                $ref: '#/components/schemas/GetEnvironmentEventFlow'
              type: array
            - type: 'null'
          title: Flows
          description: The list of flows in which the artifact was reported
        artifact_compliance:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Artifact Compliance
          description: Artifact compliance in the snapshot
        snapshot_compliance:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Snapshot Compliance
          description: Environment snapshot compliance
        type:
          type: string
          title: Type
          description: Event type
        code_diff:
          anyOf:
            - type: string
            - type: 'null'
          title: Code Diff
          description: Code diff URL
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
          description: Links to the environment, artifact, and snapshot
      type: object
      required:
        - type
      title: GetEnvironmentEventResponse
    GetEnvironmentEventFlow:
      properties:
        flow_name:
          type: string
          title: Flow Name
          description: The name of the flow to which the artifact belongs
        deployments:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Deployments
          description: 'Deprecated: List of deployment ids for the artifact'
      type: object
      required:
        - flow_name
      title: GetEnvironmentEventFlow
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````