> ## 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.

# Get a service account

> Get a single service account by name.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /service-accounts/{org}/{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:
  /service-accounts/{org}/{name}:
    get:
      tags:
        - Service Accounts
      summary: Get a service account
      description: Get a single service account by name.
      operationId: get_service_account
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 1
            pattern: ^[a-zA-Z0-9\-]+$
            title: Name
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccountResponse'
        '403':
          description: You don't have permission to access this resource
          content:
            application/json:
              example:
                message: You don't have permission to access this resource
              schema:
                $ref: '#/components/schemas/ForbiddenResponseModel'
        '404':
          description: Service account not found
          content:
            application/json:
              example:
                message: Service account not found
              schema:
                $ref: '#/components/schemas/NotFoundResponseModel'
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    ServiceAccountResponse:
      properties:
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        privilege:
          type: string
          enum:
            - admin
            - member
            - snapshotter
            - reader
          title: Privilege
        creating_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Creating User Id
        created_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Created At
        for_webhook:
          anyOf:
            - type: boolean
            - type: 'null'
          title: For Webhook
        managed_by:
          anyOf:
            - $ref: '#/components/schemas/ServiceAccountManager'
            - type: 'null'
          description: >-
            What the server created this service account for and manages it on
            behalf of; absent for the organization's own accounts.
      type: object
      required:
        - name
        - display_name
        - privilege
      title: ServiceAccountResponse
    ForbiddenResponseModel:
      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
    NotFoundResponseModel:
      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
    ServiceAccountManager:
      type: string
      enum:
        - webhook
        - cloud_capture
      title: ServiceAccountManager
      description: |-
        What runs a service account the server created for an org, stored in
        the user's `managed_by` field; the customer's own accounts have none.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.