> ## 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 last closed period

> Fetch the most recent closed accounting period for an organisation.



## OpenAPI

````yaml /openAPI/openapi-20240301.json get /accounting_new/periods/last
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /accounting_new/periods/last:
    get:
      tags:
        - Accounting
      summary: Get last closed period
      description: Fetch the most recent closed accounting period for an organisation.
      operationId: Get-last-closed-period
      parameters: []
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/AccountingPeriodResponseSchema'
                  - type: 'null'
                title: Response Get-Last-Closed-Period
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AccountingPeriodResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique identifier
        organisation_id:
          type: string
          format: uuid
          title: Organisation Id
          description: Organization ID
        period_start:
          type: string
          format: date
          title: Period Start
          description: Period start date
        period_end:
          type: string
          format: date
          title: Period End
          description: Period end date
        period_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Period Name
          description: Descriptive name
        status:
          type: string
          title: Status
          description: Period status
        closed_at:
          type: string
          format: date-time
          title: Closed At
          description: When the period was closed
        closed_by_user_id:
          type: string
          format: uuid
          title: Closed By User Id
          description: User who closed the period
        closed_by_user:
          anyOf:
            - $ref: '#/components/schemas/UserResponseSchema'
            - type: 'null'
          description: User who closed the period
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Record creation timestamp
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Record update timestamp
      type: object
      required:
        - id
        - organisation_id
        - period_start
        - period_end
        - status
        - closed_at
        - closed_by_user_id
        - created_at
        - updated_at
      title: AccountingPeriodResponseSchema
      description: |-
        Response schema for an accounting period.

        Includes the closing user's information so the caller doesn't have to
        fetch it separately.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: User Id
        first_name:
          type: string
          title: First Name
          description: User First Name
        last_name:
          type: string
          title: Last Name
          description: User last Name
        email:
          type: string
          title: Email
          description: User email
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
          description: User Role
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
          description: User mobile
        rbac_role_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Rbac Role Id
          description: RBAC Role Id
        totp:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Totp
          description: Two factor setting
        additional_permissions:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Additional Permissions
          description: Additional Permissions
      type: object
      required:
        - id
        - first_name
        - last_name
        - email
      title: UserResponseSchema
      description: Create User Response Schema
    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
  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>

````