> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.zenskar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get accounts

> Fetch accounts for an organisation with optional filters and pagination.



## OpenAPI

````yaml /openAPI/openapi-20240301.json get /accounting_new/accounts
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /accounting_new/accounts:
    get:
      tags:
        - Accounting
      summary: Get accounts
      description: Fetch accounts for an organisation with optional filters and pagination.
      operationId: Get-accounts
      parameters:
        - name: order
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            examples:
              - order=created_at
            default: '-created_at'
            title: Order
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The cursor indicating a unique set of results - this should be
              auto generated and you get it from the `next` and `previous`
              fields of the response
            examples:
              - V2VsbCBhcmV1IGN1cmlvdxM=
            title: Cursor
          description: >-
            The cursor indicating a unique set of results - this should be auto
            generated and you get it from the `next` and `previous` fields of
            the response
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: The number of results to return - defaults to 10
            examples:
              - 10
            title: Limit
          description: The number of results to return - defaults to 10
        - name: id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Id
        - name: id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Id  In
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name
        - name: name__ilike
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name  Ilike
        - name: description
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Description
        - name: account_category
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AccountCategory'
              - type: 'null'
            title: Account Category
        - name: account_category__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account Category  In
        - name: parent_path
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Parent Path
        - name: parent_path__ilike
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Parent Path  Ilike
        - name: balance_normality
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/BalanceNormalityNew'
              - type: 'null'
            title: Balance Normality
        - name: balance_normality__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Balance Normality  In
        - name: is_parent
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Is Parent
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResults_AccountResponseSchema_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AccountCategory:
      type: string
      enum:
        - Assets
        - Liabilities
        - Equity
        - Income
        - Expenses
      title: AccountCategory
    BalanceNormalityNew:
      type: string
      enum:
        - credit
        - debit
      title: BalanceNormalityNew
    PaginatedResults_AccountResponseSchema_:
      properties:
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
          description: The cursor for the next page of results
          examples:
            - V2VsbCBhcmV1IGN1cmlvdxM=
        previous:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous
          description: The cursor for the previous page of results
          examples:
            - GmBsbCBhcmV1IGN1cmlvdxM=
        total_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Count
          description: The total count of rows
        results:
          items:
            $ref: '#/components/schemas/AccountResponseSchema'
          type: array
          title: Results
          description: The results for the current page
      type: object
      required:
        - results
      title: PaginatedResults[AccountResponseSchema]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AccountResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        organisation_id:
          type: string
          format: uuid
          title: Organisation Id
        account_category:
          $ref: '#/components/schemas/AccountCategory'
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        balance_normality:
          $ref: '#/components/schemas/AccountMovementDirection'
        is_parent:
          type: boolean
          title: Is Parent
        parent_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Path
        custom_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Data
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - id
        - organisation_id
        - account_category
        - name
        - balance_normality
        - is_parent
        - created_at
      title: AccountResponseSchema
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AccountMovementDirection:
      type: string
      enum:
        - credit
        - debit
      title: AccountMovementDirection
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````