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

# Balance of the hours compensation absence types of an employee

> Returns, for one employee and one year, every absence type with category hours compensation that is active and assigned to the employee (directly or through company, office, department or group), with its granted, consumed, pending and available seconds. `availableSeconds` = `grantedSeconds` - `consumedSeconds` - `pendingSeconds` and is not rounded up to 0: it can be negative. An assigned absence type without balance in that year is returned with every amount at 0. Other absence type categories are never returned.

The granted total is updated asynchronously: after an adjustment with `POST /overtime-policies/v1/permit-adjustments`, this endpoint can still return the previous `grantedSeconds` for a few seconds.

The API consumer needs permission over the employee; an employee of another company makes the request fail with 403.



## OpenAPI

````yaml GET /schedule/v1/employees/{employeeId}/hours-compensation-balances
openapi: 3.0.0
info:
  description: ''
  version: 3.0.0
  title: Sesame Public API
servers:
  - url: https://api-{region}.sesametime.com
    variables:
      region:
        default: eu1
security: []
tags: []
paths:
  /schedule/v1/employees/{employeeId}/hours-compensation-balances:
    get:
      tags:
        - Absence Types
      summary: Balance of the hours compensation absence types of an employee
      description: >-
        Returns, for one employee and one year, every absence type with category
        hours compensation that is active and assigned to the employee (directly
        or through company, office, department or group), with its granted,
        consumed, pending and available seconds. `availableSeconds` =
        `grantedSeconds` - `consumedSeconds` - `pendingSeconds` and is not
        rounded up to 0: it can be negative. An assigned absence type without
        balance in that year is returned with every amount at 0. Other absence
        type categories are never returned.


        The granted total is updated asynchronously: after an adjustment with
        `POST /overtime-policies/v1/permit-adjustments`, this endpoint can still
        return the previous `grantedSeconds` for a few seconds.


        The API consumer needs permission over the employee; an employee of
        another company makes the request fail with 403.
      operationId: ListEmployeeHoursCompensationBalances
      parameters:
        - in: path
          name: employeeId
          required: true
          description: Employee ID.
          schema:
            type: string
            format: uuid
        - in: query
          name: year
          required: false
          description: Year of the balance (4 digits). Defaults to the current year.
          schema:
            type: integer
            example: 2026
      responses:
        '200':
          description: >-
            Balance of each hours compensation absence type assigned to the
            employee in the requested year, ordered by name. Empty array when
            the employee has none assigned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - absenceTypeId
                        - name
                        - year
                        - grantedSeconds
                        - consumedSeconds
                        - pendingSeconds
                        - availableSeconds
                      properties:
                        absenceTypeId:
                          type: string
                          format: uuid
                          description: Hours compensation absence type ID.
                        name:
                          type: string
                          description: Display name of the absence type
                          example: Tardes viernes
                        year:
                          type: integer
                          description: Year of the balance
                          example: 2026
                        grantedSeconds:
                          type: integer
                          description: >-
                            Granted total in seconds for the year: what was
                            compensated from the overtime policy plus every
                            adjustment. Can be negative. Updated asynchronously
                            a few seconds after an adjustment.
                          example: 7200
                        consumedSeconds:
                          type: integer
                          description: >-
                            Seconds already taken as absences of this type in
                            the year
                          example: 3600
                        pendingSeconds:
                          type: integer
                          description: Seconds requested and pending approval
                          example: 1800
                        availableSeconds:
                          type: integer
                          description: >-
                            grantedSeconds - consumedSeconds - pendingSeconds.
                            Not rounded up to 0: can be negative.
                          example: 1800
                  meta:
                    type: object
                    properties:
                      currentPage:
                        type: integer
                        example: 1
                      lastPage:
                        type: integer
                        example: 1
                      total:
                        type: integer
                        example: 1
                      perPage:
                        type: integer
                        example: 1
              example:
                data:
                  - absenceTypeId: 199932f8-c295-42b9-8588-b5ec181a3767
                    name: Tardes viernes
                    year: 2026
                    grantedSeconds: 7200
                    consumedSeconds: 3600
                    pendingSeconds: 1800
                    availableSeconds: 1800
                  - absenceTypeId: 6a1f0c34-8d0e-4b8e-9a43-2f5d3c1e7b90
                    name: Excedente convenio
                    year: 2026
                    grantedSeconds: -3600
                    consumedSeconds: 0
                    pendingSeconds: 0
                    availableSeconds: -3600
        '401':
          description: Unauthorized - Invalid or missing API Key
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message indicating authentication failure
                    example: Invalid or missing API Key
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: UNAUTHORIZED
              example:
                message: Invalid or missing API Key
                code: UNAUTHORIZED
        '403':
          description: >-
            Forbidden - The API consumer has no permission over the employee, or
            the company has no absences module.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '422':
          description: |-
            Unprocessable Entity - Validation errors:

            - `employeeId` is not a valid UUID
            - `year` is not a 4-digit year
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Validation error message key
                  errors:
                    type: object
                    description: Field-specific validation errors
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message indicating rate limit exceeded
                    example: Rate limit exceeded. Please try again later.
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: RATE_LIMIT_EXCEEDED
                  retryAfter:
                    type: integer
                    description: Number of seconds to wait before retrying
                    example: 60
              example:
                message: Rate limit exceeded. Please try again later.
                code: RATE_LIMIT_EXCEEDED
                retryAfter: 60
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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