> ## 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/service-accounts/list-api-keys-for-a-service-account",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# List API keys for a service account

> List all active API keys for a service account.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /service-accounts/{org}/{name}/api-keys
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:
  /service-accounts/{org}/{name}/api-keys:
    get:
      tags:
        - Service Accounts
      summary: List API keys for a service account
      description: List all active API keys for a service account.
      operationId: list_service_account_api_keys_service_accounts__org___name__api_keys_get
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiKeyListItemResponse'
                title: >-
                  Response List Service Account Api Keys Service Accounts  Org  
                  Name  Api Keys Get
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__ForbiddenResponse___locals___ForbiddenResponseModel__5
        '404':
          description: Service account not found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__40
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    ApiKeyListItemResponse:
      properties:
        id:
          type: string
          title: Id
        description:
          type: string
          title: Description
        created_at:
          type: number
          title: Created At
        expires_at:
          type: integer
          title: Expires At
        last_used_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Last Used At
      type: object
      required:
        - id
        - description
        - created_at
        - expires_at
      title: ApiKeyListItemResponse
    fastapi_app__errors__ForbiddenResponse___locals___ForbiddenResponseModel__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: ForbiddenResponseModel
      examples:
        - message: You don't have permission to access this resource
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__40:
      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: Service account not found
      examples:
        - message: Service account not found
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````