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

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

</AgentInstructions>

# Get policy

> Get a Policy in an organization.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /policies/{org}/{policy_name}
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:
  /policies/{org}/{policy_name}:
    get:
      tags:
        - Policies
      summary: Get policy
      description: Get a Policy in an organization.
      operationId: get_policy_policies__org___policy_name__get
      parameters:
        - name: policy_name
          in: path
          required: true
          schema:
            type: string
            title: Policy Name
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyResponse'
        '404':
          description: Policy Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__30
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    PolicyResponse:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        created_by:
          type: string
          title: Created By
        created_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Created At
        last_modified_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Last Modified At
        archived:
          type: boolean
          title: Archived
          default: false
        versions:
          items:
            $ref: '#/components/schemas/VersionedPolicy'
          type: array
          title: Versions
          default: []
        events:
          items:
            $ref: '#/components/schemas/PolicyEvent'
          type: array
          title: Events
          default: []
        consuming_envs:
          items:
            type: string
          type: array
          title: Consuming Envs
          default: []
      type: object
      required:
        - name
        - description
        - created_by
      title: PolicyResponse
      description: >-
        Response model for a policy


        This represents the response structure when retrieving, creating or
        updating a policy.
      examples:
        - archived: false
          consuming_envs:
            - production
          created_at: 1633123456
          created_by: John Doe
          description: Production environment policy
          events:
            - data:
                version: 1
              timestamp: 1633123456
              type: policy_created
              user: John Doe
          last_modified_at: 1633123456
          name: production-policy
          versions:
            - comment: Initial version
              created_by: John Doe
              policy_yaml: |-
                _schema: https://kosli.com/schemas/policy/environment/v1

                artifacts:
                  provenance:
                    required: false
              timestamp: 1633123456
              version: 1
    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: Policy not found
      examples:
        - message: Policy not found
    VersionedPolicy:
      properties:
        version:
          type: integer
          title: Version
        comment:
          type: string
          title: Comment
          default: ''
        timestamp:
          type: number
          title: Timestamp
        created_by:
          type: string
          title: Created By
        policy_yaml:
          type: string
          title: Policy Yaml
      additionalProperties: false
      type: object
      required:
        - version
        - timestamp
        - created_by
        - policy_yaml
      title: VersionedPolicy
    PolicyEvent:
      properties:
        type:
          type: string
          enum:
            - creation
            - metadata_update
            - new_version
            - renaming
            - archiving
          title: Type
        timestamp:
          type: number
          title: Timestamp
        user:
          type: string
          title: User
        data:
          additionalProperties: true
          type: object
          title: Data
      type: object
      required:
        - type
        - timestamp
        - user
      title: PolicyEvent
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````