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

# Get the balance of every overtime rule of an employee

> Returns, for the employee `employeeId` and the `from`-`to` period (closed days only: up to yesterday), the balance of every multiplier and typifying rule assigned to the employee or with generated time or movements in the period. The balance is the generated time plus the rule adjustments, minus the rule compensations, and can be negative. Read it right before `POST /overtime-policies/v1/adjustments` with a rule source and copy from the item of the rule `ruleId` and `source` as they are, and `balanceSeconds` as `balanceBeforeSeconds`. The read permission is checked over the employee: an employee the API consumer has no role over answers 403. When the permission passes, as it does for a company-wide API consumer, an id that is not an employee of the company of the token (including an unknown id) answers 200 with an empty list.



## OpenAPI

````yaml GET /overtime-policies/v1/employees/{employeeId}/rule-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:
  /overtime-policies/v1/employees/{employeeId}/rule-balances:
    get:
      tags:
        - Overtime Policies
      summary: Get the balance of every overtime rule of an employee
      description: >-
        Returns, for the employee `employeeId` and the `from`-`to` period
        (closed days only: up to yesterday), the balance of every multiplier and
        typifying rule assigned to the employee or with generated time or
        movements in the period. The balance is the generated time plus the rule
        adjustments, minus the rule compensations, and can be negative. Read it
        right before `POST /overtime-policies/v1/adjustments` with a rule source
        and copy from the item of the rule `ruleId` and `source` as they are,
        and `balanceSeconds` as `balanceBeforeSeconds`. The read permission is
        checked over the employee: an employee the API consumer has no role over
        answers 403. When the permission passes, as it does for a company-wide
        API consumer, an id that is not an employee of the company of the token
        (including an unknown id) answers 200 with an empty list.
      operationId: GetEmployeeOvertimeRuleBalances
      parameters:
        - name: employeeId
          in: path
          required: true
          description: The employee ID. It must belong to the company of the token.
          schema:
            type: string
            format: uuid
        - name: from
          in: query
          required: true
          description: First day of the period (Y-m-d). Must not be after `to`.
          schema:
            type: string
            format: date
            example: '2026-01-01'
        - name: to
          in: query
          required: true
          description: >-
            Last day of the period (Y-m-d), inclusive. It can be equal to
            `from`.
          schema:
            type: string
            format: date
            example: '2026-01-31'
      responses:
        '200':
          description: >-
            Balance of every rule of the employee for the period, multiplier
            rules first, then typifying rules. When the period has no closed day
            (it starts today or later) the assigned rules are listed with
            `balanceSeconds` 0. `meta` counts the items (`total` = `perPage` =
            number of rules).
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      description: >-
                        Balance of one overtime rule of the employee for the
                        requested period, in seconds
                        (EmployeeRuleBalanceForApiView).
                      required:
                        - ruleId
                        - name
                        - source
                        - balanceSeconds
                        - hoursCompensationAbsenceTypeId
                      properties:
                        ruleId:
                          type: string
                          format: uuid
                          description: >-
                            The rule ID. Send it as `ruleId` when adjusting this
                            rule.
                          example: 55555555-5555-4555-8555-555555555555
                        name:
                          type: string
                          example: Viernes tarde
                        source:
                          type: string
                          enum:
                            - multiplier_rule
                            - typifying_rule
                          description: >-
                            Kind of the rule, as the adjustment source:
                            `multiplier_rule` for a multiplier rule,
                            `typifying_rule` for a typifying rule. Send it as is
                            as `source` when adjusting this rule.
                          example: multiplier_rule
                        balanceSeconds:
                          type: integer
                          description: >-
                            Rule balance; it can be negative. Value to send as
                            `balanceBeforeSeconds` when adjusting this rule.
                          example: 8100
                        hoursCompensationAbsenceTypeId:
                          type: string
                          format: uuid
                          nullable: true
                          description: >-
                            Absence type linked to the rule for hours
                            compensation; null when the rule has none or it
                            cannot be resolved.
                          example: null
                  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:
                  - ruleId: 55555555-5555-4555-8555-555555555555
                    name: Viernes tarde
                    source: multiplier_rule
                    balanceSeconds: 8100
                    hoursCompensationAbsenceTypeId: null
                  - ruleId: 66666666-6666-4666-8666-666666666666
                    name: Nocturnidad
                    source: typifying_rule
                    balanceSeconds: 3600
                    hoursCompensationAbsenceTypeId: 199932f8-c295-42b9-8588-b5ec181a3767
                meta:
                  currentPage: 1
                  lastPage: 1
                  total: 2
                  perPage: 2
        '401':
          description: >-
            Unauthorized - The `Authorization: Bearer` token is missing, unknown
            or disabled (`unauthorized`, UnauthorizedHttpException), or the API
            token has expired (`api_token_expired`,
            ApiConsumerSessionExpiredException).
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope produced by JsonApiResponseFactory for every
                  non-2xx response.
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - status
                      - message
                      - errors
                    properties:
                      status:
                        type: integer
                        description: HTTP status code, repeated in the body
                        example: 422
                      message:
                        type: string
                        description: >-
                          Error message. For domain and authentication errors it
                          is a stable error code; for request validation errors
                          it is `Unprocessable entity`.
                        example: employee_not_adjustable
                      errors:
                        description: >-
                          For domain and authentication errors, a stable error
                          code (string) to branch on. For request validation
                          errors, an object keyed by field name whose value is
                          the list of messages for that field (translated into
                          the request locale).
                        oneOf:
                          - type: string
                            example: employee_not_adjustable
                          - type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                            example:
                              employeeId:
                                - validator.invalid_uuid
              examples:
                unauthorized:
                  summary: Missing, unknown or disabled token
                  value:
                    error:
                      status: 401
                      message: Unauthorized
                      errors: unauthorized
                api_token_expired:
                  summary: Expired API token
                  value:
                    error:
                      status: 401
                      message: api_token_expired
                      errors: api_token_expired
        '402':
          description: >-
            Payment Required - The subscription of the company of the token is
            cancelled (SubscriptionPseudoCancelledException).
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope produced by JsonApiResponseFactory for every
                  non-2xx response.
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - status
                      - message
                      - errors
                    properties:
                      status:
                        type: integer
                        description: HTTP status code, repeated in the body
                        example: 422
                      message:
                        type: string
                        description: >-
                          Error message. For domain and authentication errors it
                          is a stable error code; for request validation errors
                          it is `Unprocessable entity`.
                        example: employee_not_adjustable
                      errors:
                        description: >-
                          For domain and authentication errors, a stable error
                          code (string) to branch on. For request validation
                          errors, an object keyed by field name whose value is
                          the list of messages for that field (translated into
                          the request locale).
                        oneOf:
                          - type: string
                            example: employee_not_adjustable
                          - type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                            example:
                              employeeId:
                                - validator.invalid_uuid
              examples:
                subscription_expired:
                  summary: Cancelled subscription
                  value:
                    error:
                      status: 402
                      message: subscription_expired
                      errors: subscription_expired
        '403':
          description: >-
            Forbidden - The token is not an API consumer token, the company has
            no access to the Public API, or the API consumer has no role over
            the affected entity (ForbiddenAccessPermissionException, raised by
            VerifyPublicAPIAddonIsEnabledMiddleware or by the permission check
            of the command / query).
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope produced by JsonApiResponseFactory for every
                  non-2xx response.
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - status
                      - message
                      - errors
                    properties:
                      status:
                        type: integer
                        description: HTTP status code, repeated in the body
                        example: 422
                      message:
                        type: string
                        description: >-
                          Error message. For domain and authentication errors it
                          is a stable error code; for request validation errors
                          it is `Unprocessable entity`.
                        example: employee_not_adjustable
                      errors:
                        description: >-
                          For domain and authentication errors, a stable error
                          code (string) to branch on. For request validation
                          errors, an object keyed by field name whose value is
                          the list of messages for that field (translated into
                          the request locale).
                        oneOf:
                          - type: string
                            example: employee_not_adjustable
                          - type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                            example:
                              employeeId:
                                - validator.invalid_uuid
              examples:
                forbidden_access_permission:
                  summary: No access
                  value:
                    error:
                      status: 403
                      message: Forbidden Access Permission
                      errors: forbidden_access_permission
        '422':
          description: >-
            Unprocessable Entity - The path or query string failed validation
            (FindEmployeeRuleBalancesForApiValidator): `employeeId` not a UUID
            (`validator.invalid_uuid`); `from` or `to` missing or blank
            (`validator.not_null`, `validator.not_blank`) or not a Y-m-d date
            (`validator.invalid_type`); `from` after `to`, reported on `from`
            (`validator.invalid_date`). `message` is `Unprocessable entity` and
            `errors` is an object keyed by field. The field messages listed are
            translation keys: the response carries their text in the request
            locale (the key itself when there is no translation), so branch on
            the field name, not on the message.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope produced by JsonApiResponseFactory for every
                  non-2xx response.
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - status
                      - message
                      - errors
                    properties:
                      status:
                        type: integer
                        description: HTTP status code, repeated in the body
                        example: 422
                      message:
                        type: string
                        description: >-
                          Error message. For domain and authentication errors it
                          is a stable error code; for request validation errors
                          it is `Unprocessable entity`.
                        example: employee_not_adjustable
                      errors:
                        description: >-
                          For domain and authentication errors, a stable error
                          code (string) to branch on. For request validation
                          errors, an object keyed by field name whose value is
                          the list of messages for that field (translated into
                          the request locale).
                        oneOf:
                          - type: string
                            example: employee_not_adjustable
                          - type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                            example:
                              employeeId:
                                - validator.invalid_uuid
              examples:
                missing_dates:
                  summary: '`from`/`to` missing'
                  value:
                    error:
                      status: 422
                      message: Unprocessable entity
                      errors:
                        from:
                          - validator.not_null
                          - validator.not_blank
                        to:
                          - validator.not_null
                          - validator.not_blank
                from_after_to:
                  summary: '`from` after `to`'
                  value:
                    error:
                      status: 422
                      message: Unprocessable entity
                      errors:
                        from:
                          - validator.invalid_date
        '429':
          description: >-
            Too Many Requests - The company of the token exceeded the API
            consumer call limit (1000 calls per minute)
            (ApiConsumerSessionCallMaxExceededException).
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope produced by JsonApiResponseFactory for every
                  non-2xx response.
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - status
                      - message
                      - errors
                    properties:
                      status:
                        type: integer
                        description: HTTP status code, repeated in the body
                        example: 422
                      message:
                        type: string
                        description: >-
                          Error message. For domain and authentication errors it
                          is a stable error code; for request validation errors
                          it is `Unprocessable entity`.
                        example: employee_not_adjustable
                      errors:
                        description: >-
                          For domain and authentication errors, a stable error
                          code (string) to branch on. For request validation
                          errors, an object keyed by field name whose value is
                          the list of messages for that field (translated into
                          the request locale).
                        oneOf:
                          - type: string
                            example: employee_not_adjustable
                          - type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                            example:
                              employeeId:
                                - validator.invalid_uuid
              examples:
                api_consumer_rate_limit_exceeded:
                  summary: Rate limit exceeded
                  value:
                    error:
                      status: 429
                      message: Api consumer rate limit exceeded
                      errors: api_consumer_rate_limit_exceeded
      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.