# Creating one or many Time Off Entries

Creates a single or multiple time off entries for a user. Multiple time off entries can be created for
the same day, in a single request or separate requests. Entries for the same day are combined into one
time off entry. Time off hours cannot exceed the user's possible workday hours for that day.


This endpoint returns structured Time Off Entry objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the time_off_entries top-level JSON key.
Please see our Response Format section for more information.

Endpoint: POST /time_off_entries
Version: 1.0.0

## Query parameters:

  - `include` (string)
    Any of the below associations can be included in your request by providing the include param, e.g. include=association1,association2.
- external_references (ExternalReference) - Includes references to external integrations for this object.
- role (Role) - Retrieves the account role of the user associated to the time off entry, if any. The response will include role_id, which references the data in the roles top-level key.
- user (User) - Reference the user associated to the time off entry.

## Request fields (application/json):

  - `time_off_entry` (object)

  - `time_off_entry.user_id` (integer, required)
    The ID of the user who has requested time off.

  - `time_off_entry.hours` (number, required)
    The number of hours of time off requested for the day (quarter hour increments recommended).

  - `time_off_entry.requested_date` (string, required)
    The date for which time off is requested. The date must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `time_off_entry.external_reference` (object)
    Typically populated programmatically by a third party system via an integration, this is an optional
object that holds data from an external system. It connects objects in an external system with objects in
Kantata OX (for example, to connect a Jira issue to a Kantata OX Project).

  - `time_off_entry.external_reference.service_name` (string, required)
    The provider name of the integration. If you are adding multiple external references to the same object, the service_name must be unique.

  - `time_off_entry.external_reference.service_model` (string, required)
    The object type of the external object this external reference belongs to.

  - `time_off_entry.external_reference.service_model_ref` (string, required)
    The object ID of the external object this external reference belongs to.

  - `time_off_entry.external_reference.status` (string)
    The status of the integration. Options are successful, pending,  or failed.

  - `time_off_entry.external_reference.external_message` (string)
    The message on the external object.

  - `time_off_entry.external_reference.external_link` (string)
    The link to the external object.

  - `time_off_entry.external_reference.external_status` (string)
    The status of the external object in the external system.

  - `time_off_entry.external_reference.locked` (boolean)
    Whether the subject is locked.

  - `time_off_entries` (array)
    Multiple time off entries and their attributes in an array.

  - `time_off_entries.user_id` (integer, required)
    The ID of the user who has requested time off.

  - `time_off_entries.hours` (number, required)
    The number of hours of time off requested for the day (quarter hour increments recommended).

  - `time_off_entries.requested_date` (string, required)
    The date for which time off is requested. The date must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `time_off_entries.external_reference` (object)
    Typically populated programmatically by a third party system via an integration, this is an optional
object that holds data from an external system. It connects objects in an external system with objects in
Kantata OX (for example, to connect a Jira issue to a Kantata OX Project).

  - `time_off_entries.external_reference.service_name` (string, required)
    The provider name of the integration. If you are adding multiple external references to the same object, the service_name must be unique.

  - `time_off_entries.external_reference.service_model` (string, required)
    The object type of the external object this external reference belongs to.

  - `time_off_entries.external_reference.service_model_ref` (string, required)
    The object ID of the external object this external reference belongs to.

  - `time_off_entries.external_reference.status` (string)
    The status of the integration. Options are successful, pending,  or failed.

  - `time_off_entries.external_reference.external_message` (string)
    The message on the external object.

  - `time_off_entries.external_reference.external_link` (string)
    The link to the external object.

  - `time_off_entries.external_reference.external_status` (string)
    The status of the external object in the external system.

  - `time_off_entries.external_reference.locked` (boolean)
    Whether the subject is locked.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

  - `time_off_entries` (object)

  - `external_references` (object)

  - `users` (object)

  - `roles` (object)

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)


