> ## 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/get-environment-audit-log",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# Get environment audit log

> Get audit log (as a CSV file) for an environment.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /environments/{org}/{env_name}/auditlog
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}/auditlog:
    get:
      tags:
        - Environments
      summary: Get environment audit log
      description: Get audit log (as a CSV file) for an environment.
      operationId: get_env_auditlog_environments__org___env_name__auditlog_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: from_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: >-
              From timestamp filter. Takes a UNIX timestamp. e.g.
              from_timestamp=1675167540
            title: From Timestamp
          description: >-
            From timestamp filter. Takes a UNIX timestamp. e.g.
            from_timestamp=1675167540
        - name: to_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: >-
              To timestamp filter. Takes a UNIX timestamp. e.g.
              from_timestamp=1675167540
            title: To Timestamp
          description: >-
            To timestamp filter. Takes a UNIX timestamp. e.g.
            from_timestamp=1675167540
        - name: event_types
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Event types filter. Can be one of started, exited, changed. e.g.
              event_types=started,exited
            title: Event Types
          description: >-
            Event types filter. Can be one of started, exited, changed. e.g.
            event_types=started,exited
        - name: flow_names
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Flow names filter as comma separated list. Use 'no provenance' to
              include artifacts without provenance.e.g. flow_names=server,web,no
              provenance
            title: Flow Names
          description: >-
            Flow names filter as comma separated list. Use 'no provenance' to
            include artifacts without provenance.e.g. flow_names=server,web,no
            provenance
        - name: repo_names
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Repo names filter as comma separated list. e.g.
              repo_names=repo1,repo2
            title: Repo Names
          description: >-
            Repo names filter as comma separated list. e.g.
            repo_names=repo1,repo2
      responses:
        '200':
          description: Successful audit log retrieval
          content:
            application/json:
              schema: {}
          headers:
            content-type:
              schema:
                type: string
                example: text/csv; charset=utf-8
              description: Content type of the response
        '404':
          description: Environment Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__27
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__27:
      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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````