> ## 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 overtime balance of an employee

> Returns the total, positive and negative overtime balance of the employee `employeeId` for the `from`-`to` period, including the adjustments already applied. Read it right before `POST /overtime-policies/v1/adjustments` and send the value of the matching key as `balanceBeforeSeconds`. The employee must belong to the company of the token. The read permission is checked over the employee before the lookup, so an id the API consumer has no role over (including an unknown id) answers 403; 404 `employee_not_adjustable` is returned when the permission passes but the employee does not belong to the company of the token.



## OpenAPI

````yaml GET /overtime-policies/v1/employees/{employeeId}/balance
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}/balance:
    get:
      tags:
        - Overtime Policies
      summary: Get the overtime balance of an employee
      description: >-
        Returns the total, positive and negative overtime balance of the
        employee `employeeId` for the `from`-`to` period, including the
        adjustments already applied. Read it right before `POST
        /overtime-policies/v1/adjustments` and send the value of the matching
        key as `balanceBeforeSeconds`. The employee must belong to the company
        of the token. The read permission is checked over the employee before
        the lookup, so an id the API consumer has no role over (including an
        unknown id) answers 403; 404 `employee_not_adjustable` is returned when
        the permission passes but the employee does not belong to the company of
        the token.
      operationId: GetEmployeeOvertimeBalance
      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: >-
            Overtime balance of the employee for the period. The status is 200;
            `meta` is the default meta of an associative array
            (`total`/`perPage` count its three keys).
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    description: >-
                      Current overtime balance of the employee for the requested
                      period, in seconds, including the adjustments already
                      applied (EmployeeBalanceForApiView::toResponsePayload).
                      Every value is clamped at 0.
                    required:
                      - total_balance
                      - positive_balance
                      - negative_balance
                    properties:
                      total_balance:
                        type: integer
                        minimum: 0
                        description: >-
                          Net balance (positive minus negative); 0 when the net
                          balance is negative. Value to send as
                          `balanceBeforeSeconds` for sources `total_balance`,
                          `multiplier_rule` and `typifying_rule`.
                        example: 7200
                      positive_balance:
                        type: integer
                        minimum: 0
                        description: >-
                          Positive balance. Value to send as
                          `balanceBeforeSeconds` for source `positive_balance`.
                        example: 9000
                      negative_balance:
                        type: integer
                        minimum: 0
                        description: >-
                          Magnitude of the negative balance (a positive number).
                          Value to send as `balanceBeforeSeconds` for source
                          `negative_balance`.
                        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:
                  total_balance: 7200
                  positive_balance: 9000
                  negative_balance: 1800
                meta:
                  currentPage: 1
                  lastPage: 1
                  total: 3
                  perPage: 3
        '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
        '404':
          description: >-
            Not Found - The employee does not belong to the company of the token
            (EmployeeNotAdjustableException, raised by
            EmployeeAdjustabilityGuard::assertReadable).
          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:
                employee_not_adjustable:
                  summary: Employee not in the company of the token
                  value:
                    error:
                      status: 404
                      message: employee_not_adjustable
                      errors: employee_not_adjustable
        '422':
          description: >-
            Unprocessable Entity - The query string failed validation
            (FindEmployeeBalanceForApiValidator): `from` or `to` missing, blank
            or not a Y-m-d date, or `from` after `to` (reported on `from`).
            `message` is `Unprocessable entity` and `errors` is an object keyed
            by field.
          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.