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

# Add or subtract time to the hours compensation permit of an employee

> Adds (positive `amountSeconds`) or subtracts (negative `amountSeconds`) time to the granted time of an hours compensation absence type (permit) of one employee of the company of the token, for one year. It does not change the overtime balance of the employee and works whether or not the employee has an overtime policy. The granted time of a permit is the time compensated from the overtime policy (never below 0 on its own) plus every adjustment, so adjustments can leave it negative, without lower limit; with less than 1 minute available the employee cannot request time of that permit.

Idempotency: `externalReference` is mandatory and unique per company. Sending it again with the same data returns the original adjustment without applying it again; sending it with other data is rejected with 409 `permit_adjustment_reference_conflict`.

The change is shown in the history of the permit with its note and origin; the employee is not notified. The granted time read from the absences endpoints is updated asynchronously, a few seconds after the response. To correct an adjustment, send another one with the opposite sign and a new reference.



## OpenAPI

````yaml POST /overtime-policies/v1/permit-adjustments
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/permit-adjustments:
    post:
      tags:
        - Overtime Policies
      summary: Add or subtract time to the hours compensation permit of an employee
      description: >-
        Adds (positive `amountSeconds`) or subtracts (negative `amountSeconds`)
        time to the granted time of an hours compensation absence type (permit)
        of one employee of the company of the token, for one year. It does not
        change the overtime balance of the employee and works whether or not the
        employee has an overtime policy. The granted time of a permit is the
        time compensated from the overtime policy (never below 0 on its own)
        plus every adjustment, so adjustments can leave it negative, without
        lower limit; with less than 1 minute available the employee cannot
        request time of that permit.


        Idempotency: `externalReference` is mandatory and unique per company.
        Sending it again with the same data returns the original adjustment
        without applying it again; sending it with other data is rejected with
        409 `permit_adjustment_reference_conflict`.


        The change is shown in the history of the permit with its note and
        origin; the employee is not notified. The granted time read from the
        absences endpoints is updated asynchronously, a few seconds after the
        response. To correct an adjustment, send another one with the opposite
        sign and a new reference.
      operationId: CreateHoursCompensationPermitAdjustment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - employeeId
                - absenceTypeId
                - amountSeconds
                - externalReference
              properties:
                employeeId:
                  type: string
                  format: uuid
                  description: >-
                    Employee whose permit is adjusted. Must belong to the
                    company of the token.
                absenceTypeId:
                  type: string
                  format: uuid
                  description: >-
                    Hours compensation absence type to adjust. Must be active
                    and assigned to the employee (see `GET
                    /schedule/v1/employees/available-hours-compensation-types`).
                year:
                  type: integer
                  description: >-
                    Year of the permit balance to adjust. Optional: the current
                    year when omitted. Any past or future year is accepted.
                  example: 2026
                amountSeconds:
                  type: integer
                  description: >-
                    Seconds to add (positive) or subtract (negative). Must not
                    be `0`.
                  example: 8100
                externalReference:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: >-
                    Reference of the movement in the system of the integrator,
                    unique per company. It makes retries safe (see the
                    idempotency note above).
                  example: EPS-2026-000123
                note:
                  type: string
                  nullable: true
                  maxLength: 255
                  description: >-
                    Free text stored with the adjustment and shown in the
                    history of the permit
                  example: Tardes viernes 14/11
            examples:
              add:
                summary: Add 2 h 15 min to the current year
                value:
                  employeeId: 550e8400-e29b-41d4-a716-446655440000
                  absenceTypeId: 199932f8-c295-42b9-8588-b5ec181a3767
                  amountSeconds: 8100
                  externalReference: EPS-2026-000123
                  note: Tardes viernes 14/11
              subtract:
                summary: Subtract 30 min from 2025
                value:
                  employeeId: 550e8400-e29b-41d4-a716-446655440000
                  absenceTypeId: 199932f8-c295-42b9-8588-b5ec181a3767
                  year: 2025
                  amountSeconds: -1800
                  externalReference: EPS-2025-000987
      responses:
        '200':
          description: >-
            Adjustment applied, or the original adjustment when the same
            `externalReference` was already used with the same data (idempotent
            retry: nothing is applied twice). The status is 200 (not 201)
            because the controller answers through `fromRawData`.


            The granted time shown by the absences endpoints (`GET
            /schedule/v1/employees/{employeeId}/hours-compensation-balances`,
            `GET /schedule/v1/absence-calendars/employees/{employeeId}/totals`)
            is updated asynchronously, a few seconds after this response;
            `grantedAfterSeconds` already carries the resulting value.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - adjustmentId
                      - employeeId
                      - absenceTypeId
                      - year
                      - amountSeconds
                      - externalReference
                      - note
                      - origin
                      - grantedAfterSeconds
                      - createdAt
                    properties:
                      adjustmentId:
                        type: string
                        format: uuid
                        description: ID of the adjustment
                        example: 6c1f2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
                      employeeId:
                        type: string
                        format: uuid
                        description: The adjusted employee
                      absenceTypeId:
                        type: string
                        format: uuid
                        description: >-
                          Hours compensation absence type whose granted time was
                          adjusted
                      year:
                        type: integer
                        description: Year of the permit balance the adjustment applies to
                        example: 2026
                      amountSeconds:
                        type: integer
                        description: >-
                          Seconds added (positive) or subtracted (negative) to
                          the granted time of the permit
                        example: 8100
                      externalReference:
                        type: string
                        nullable: true
                        description: >-
                          Reference sent by the integrator. `null` only for the
                          adjustments Sesame creates itself when the permit is
                          unassigned (origin `unassign`).
                        example: EPS-2026-000123
                      note:
                        type: string
                        nullable: true
                        description: Free text stored with the adjustment
                        example: Tardes viernes 14/11
                      origin:
                        type: string
                        enum:
                          - api_public
                          - unassign
                        description: >-
                          `api_public`: created through this API. `unassign`:
                          created by Sesame when the employee was unassigned
                          from the permit, to leave its available time at 0
                          (what was added by adjustments is lost).
                      grantedAfterSeconds:
                        type: integer
                        description: >-
                          Granted time of the permit for that year right after
                          this adjustment, in seconds: the time compensated from
                          the overtime policy (never below 0 on its own) plus
                          every adjustment. It can be negative.
                        example: 11700
                      createdAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                  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:
                  adjustmentId: 6c1f2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
                  employeeId: 550e8400-e29b-41d4-a716-446655440000
                  absenceTypeId: 199932f8-c295-42b9-8588-b5ec181a3767
                  year: 2026
                  amountSeconds: 8100
                  externalReference: EPS-2026-000123
                  note: Tardes viernes 14/11
                  origin: api_public
                  grantedAfterSeconds: 11700
                  createdAt: '2026-11-17T10:30:00+00:00'
                meta:
                  currentPage: 1
                  lastPage: 1
                  total: 1
                  perPage: 1
        '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
        '409':
          description: >-
            Conflict - The `externalReference` was already used in the company
            for an adjustment with other data (employee, absence type, year,
            amount or note) (PermitAdjustmentReferenceConflictException).
            Nothing is applied. The same 409 answers a request that is still
            being saved with the same reference at the same time: retry it and
            you get the original adjustment.
          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
              example:
                error:
                  status: 409
                  message: permit_adjustment_reference_conflict
                  errors: permit_adjustment_reference_conflict
        '422':
          description: >-
            Unprocessable Entity - Either the body failed validation
            (CreatePermitAdjustmentForApiValidator: `message` is `Unprocessable
            entity` and `errors` is an object keyed by field), or a domain rule
            rejected the request (`errors` is the error code). Nothing is
            applied.


            Validation (`errors` keyed by field; the messages are translation
            keys rendered in the request locale, so branch on the field name):


            - `employeeId` or `absenceTypeId` missing or not a UUID.

            - `amountSeconds` missing, not an integer or `0`.

            - `externalReference` missing, empty or longer than 100 characters.

            - `year` not an integer of 4 digits.

            - `note` longer than 255 characters.


            Domain (`errors` is the code):


            - `hours_compensation_absence_type_not_available` - `absenceTypeId`
            is not an hours compensation absence type available for the
            employee: not assigned, inactive, deleted, of another category or of
            another company (HoursCompensationAbsenceTypeNotAvailableException).
            Use `GET /schedule/v1/employees/available-hours-compensation-types`
            to list the valid ones.

            - `hours_compensation_absence_types_unavailable` - The availability
            of the absence type could not be checked; retry later
            (HoursCompensationAbsenceTypesUnavailableException).
          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:
                validation:
                  summary: Body validation failed
                  value:
                    error:
                      status: 422
                      message: Unprocessable entity
                      errors:
                        amountSeconds:
                          - validator.not_null
                        externalReference:
                          - validator.not_null
                hours_compensation_absence_type_not_available:
                  summary: >-
                    `absenceTypeId` is not an hours compensation absence type
                    available for the employee
                  value:
                    error:
                      status: 422
                      message: hours_compensation_absence_type_not_available
                      errors: hours_compensation_absence_type_not_available
                hours_compensation_absence_types_unavailable:
                  summary: >-
                    The availability of the absence type could not be checked;
                    retry later
                  value:
                    error:
                      status: 422
                      message: hours_compensation_absence_types_unavailable
                      errors: hours_compensation_absence_types_unavailable
        '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.