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

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

</AgentInstructions>

# Report K8S environment

> Process a report for a K8S environment.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json put /environments/{org}/{env_name}/report/K8S
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}/report/K8S:
    put:
      tags:
        - Environments
      summary: Report K8S environment
      description: Process a report for a K8S environment.
      operationId: k8s_report_environments__org___env_name__report_K8S_put
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/K8SReport'
      responses:
        '200':
          description: Report processed successfully, no new snapshots to create
          content:
            application/json:
              schema: {}
        '201':
          description: Snapshot created
        '400':
          description: Invalid report data
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__ValidationErrorResponse___locals___ValidationErrorResponseModel__5
        '404':
          description: Environment Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__19
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    K8SReport:
      properties:
        type:
          type: string
          const: K8S
          title: Type
          description: Environment type
          default: K8S
        artifacts:
          items:
            $ref: '#/components/schemas/K8SArtifact'
          type: array
          title: Artifacts
          description: all artifacts in the report
      additionalProperties: false
      type: object
      required:
        - artifacts
      title: K8SReport
      description: K8S report containing pod artifacts
      examples:
        - artifacts:
            - creationTimestamp: 1632122962
              digests:
                acme/hadroncollider:1.1.1: >-
                  c84295fa0722ab01c7e6e6472fbe6369cf40b1b302cf04bb06d97c820ce621a7
              namespace: default
              podName: my-pod-abc123
    fastapi_app__errors__ValidationErrorResponse___locals___ValidationErrorResponseModel__5:
      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: ValidationErrorResponseModel
      description: Invalid report data
      examples:
        - errors:
            email: Field must be a valid email address
            name: Field cannot be empty
          message: Invalid report data
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__19:
      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
    K8SArtifact:
      properties:
        podName:
          type: string
          title: Podname
          description: Name of pod
        namespace:
          type: string
          title: Namespace
          description: Namespace of cluster
        digests:
          additionalProperties:
            type: string
            pattern: ^[a-f0-9]{64}$
          type: object
          title: Digests
          description: Image name to sha256 fingerprint mapping
        creationTimestamp:
          type: integer
          title: Creationtimestamp
          description: Creation time stamp for the pod in UTC
        owners:
          anyOf:
            - items:
                $ref: '#/components/schemas/K8SOwner'
              type: array
            - type: 'null'
          title: Owners
          description: Owner references for the pod
      additionalProperties: false
      type: object
      required:
        - podName
        - namespace
        - digests
        - creationTimestamp
      title: K8SArtifact
      description: Individual artifact (pod) in a K8S report
    K8SOwner:
      properties:
        apiVersion:
          type: string
          title: Apiversion
          description: API version of the owner
        kind:
          type: string
          title: Kind
          description: Kind of the owner
        name:
          type: string
          title: Name
          description: Name of the owner
        uid:
          type: string
          title: Uid
          description: UID of the owner
        controller:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Controller
          description: Whether the owner is a controller
        blockOwnerDeletion:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Blockownerdeletion
          description: Whether to block owner deletion
      additionalProperties: true
      type: object
      required:
        - apiVersion
        - kind
        - name
        - uid
      title: K8SOwner
      description: Owner reference for a K8S pod
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````