---
agentTools:
  projectIndex: https://kenjo.readme.io/llms.txt
---

# Return a list of time-off requests.

This endpoint returns a paginated list of time off requests for a given date range. The maximum number of time off requests to retrieve once is 92 days, so the URL params *from* and *to* are mandatory. The URL params help to return more accurate results.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Kenjo API",
    "description": "Before starting to use the Kenjo API, you have to request the API activation for a sandbox or production environment to the Kenjo Customer Success team. After that, an admin user has to go to *Settings > Integrations > API keys*, to generate the **API Key**. Follow the steps described in the **Autentication section** of this document. <br>The API key is needed to request the bearer token. Each endpoint callout requires a valid bearer token in the Authorization header. Once the token is retrieved, it will be useful during the time limit indicated by the 'expiration date'.",
    "termsOfService": "https://www.kenjo.io/legal/terms-and-conditions",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sandbox-api.kenjo.io/api/v1",
      "description": "Sandbox environment"
    },
    {
      "url": "https://api.kenjo.io/api/v1",
      "description": "Production environment"
    }
  ],
  "tags": [
    {
      "name": "Time off",
      "description": "Operations to manage time off types, policies and requests in Kenjo."
    }
  ],
  "components": {
    "responses": {
      "badRequest": {
        "description": "BAD REQUEST. This is a wrong request in the client side due to invalid body or params.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "number"
                },
                "message": {
                  "type": "string"
                }
              },
              "example": {
                "code": 400,
                "message": "The param 'id' is not valid."
              }
            }
          }
        }
      },
      "unauthorized": {
        "description": "UNAUTHORIZED. The Authorization header is incorrect, not provided or the token expired."
      }
    },
    "parameters": {
      "authorization": {
        "in": "header",
        "name": "Authorization",
        "description": "A valid bearer token.",
        "schema": {
          "type": "string",
          "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5rZW5qby5pbyIsInN1YiI6IjYwZjBhOTE2MjE0OTg3MjU2YmU5YzhmZiIsImF1ZCI6Imh0dHBzOi8vYXBpLmtlbmpvLmlvIiwiaWF0IjoxNjI2Mzg1MTE1LCJuYmYiOjE2MjYzODUxMTUsImV4cCI6MTYyNjU1NzkxNSwiYWNjZXNzVHlwZSI6IkFwaUFjY2VzcyIsInNfb3JnSWQiOiI2MGYwNGVhN2RmN2JhMjFlY2U0YmYzYzIifQ.cxG_7dIS-VbmDXdJuLkekoyuyCIzQG2fMcgc0nkfbWE8cihhcb5FnALbQkjU9b5-qVcEoMHZlSuUA-jMEBMMVQ"
        },
        "required": true
      }
    }
  },
  "paths": {
    "/time-off/requests": {
      "get": {
        "summary": "Return a list of time-off requests.",
        "description": "This endpoint returns a paginated list of time off requests for a given date range. The maximum number of time off requests to retrieve once is 92 days, so the URL params *from* and *to* are mandatory. The URL params help to return more accurate results.",
        "tags": [
          "Time off"
        ],
        "parameters": [
          {
            "in": "header",
            "$ref": "#/components/parameters/authorization"
          },
          {
            "in": "query",
            "name": "from",
            "required": true,
            "description": "A date in format YYYY-MM-DD to indicate the starting point. It needs to be equals or less than the *to* param.",
            "schema": {
              "type": "string",
              "example": "2020-01-01"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "description": "A date in format YYYY-MM-DD to indicate the ending point. It needs to be equals or greater than the *from* param.",
            "schema": {
              "type": "string",
              "example": "2020-01-10"
            }
          },
          {
            "in": "query",
            "name": "_userId",
            "required": false,
            "description": "This field allows to return only the time off requests for a given *_userId*.",
            "schema": {
              "type": "string",
              "example": "60a2db290da29e126a18789b"
            }
          },
          {
            "in": "query",
            "name": "_timeOffTypeId",
            "required": false,
            "description": "This field allows to filter by time-off type Id.",
            "schema": {
              "type": "string",
              "example": "90a2db290da29e126a187891"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "description": "This field allows to filter by the time-off request status.",
            "schema": {
              "type": "string",
              "enum": [
                "Approved",
                "Declined",
                "Cancelled",
                "Pending",
                "Submitted",
                "Processed",
                "CancelledAfterProcessed",
                "InApproval"
              ],
              "example": "Approved"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "description": "Optional filter for pagination proposals. Determines the number of pages to skip when pagination is being used. If this value is not provided, by default the offset will be 1.",
            "schema": {
              "type": "number",
              "example": 1
            }
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Optional filter for pagination proposals. The maximum number of rows to retrieve which determines the size of the page. If this value is not provided then the limit will be 50 users. The maximum value of the limit is 100 users per page. Only are valid the following limit values: 25, 50 and 100.",
            "schema": {
              "type": "number",
              "example": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "description": "The Kenjo _id of the returned time-off request.",
                            "example": "80a2db290da29e126a18789f"
                          },
                          "_userId": {
                            "type": "string",
                            "description": "The employee id associated to the time-off request.",
                            "example": "60a2db290da29e126a18789a1"
                          },
                          "_timeOffTypeId": {
                            "type": "string",
                            "description": "The time-off type id associated to the time-off request.",
                            "example": "50a2db290da29e126a187896"
                          },
                          "_policyId": {
                            "type": "string",
                            "description": "The policy id associated to the time-off request.",
                            "example": "20a2db290da29e126a187894"
                          },
                          "_policyName": {
                            "type": "string",
                            "description": "The name of the policy id associated to the time-off request.",
                            "example": "Holidays for Tech team"
                          },
                          "_policyType": {
                            "type": "string",
                            "description": "The type of the policy associated to the time-off request. It can be type *Hour* or *Day*.",
                            "example": "Day"
                          },
                          "status": {
                            "type": "string",
                            "description": "The status of the time-off request.",
                            "example": "Submitted"
                          },
                          "from": {
                            "type": "string",
                            "description": "The from date of the time-off request in format YYYY-MM-DDThh:mm:ss.",
                            "example": "2022-01-30T00:00:00"
                          },
                          "to": {
                            "type": "string",
                            "description": "The to date of the time-off request in format YYYY-MM-DDThh:mm:ss.",
                            "example": "2022-02-10T00:00:00"
                          },
                          "partOfDayFrom": {
                            "type": "string",
                            "enum": [
                              "StartOfDay",
                              "HalfOfDay"
                            ],
                            "description": "Which part of the **first** day of the range is taken off. `StartOfDay` means the whole day; `HalfOfDay` means the request starts at midday, so only that **afternoon** is taken off (it appears as `Afternoon` in `splitRequests[].partOfDay`). Only present for policies of type *Day* - policies of type *Hour* use `startTime` / `endTime` instead.\n",
                            "example": "HalfOfDay"
                          },
                          "partOfDayTo": {
                            "type": "string",
                            "enum": [
                              "HalfOfDay",
                              "EndOfDay"
                            ],
                            "description": "Which part of the **last** day of the range is taken off. `EndOfDay` means the whole day; `HalfOfDay` means the request ends at midday, so only that **morning** is taken off (it appears as `Morning` in `splitRequests[].partOfDay`). Note the asymmetry with `partOfDayFrom`: the same `HalfOfDay` value means afternoon on the first day and morning on the last one. On a single-day request both fields refer to that same day. Only present for policies of type *Day*.\n",
                            "example": "EndOfDay"
                          },
                          "duration": {
                            "type": "number",
                            "description": "Length of the request counting **every calendar day** in the `from`-`to` range, including bank holidays and non-working days. Matches the number of entries in `splitRequests`. To know how much was actually deducted from the employee's balance, use `workingTime`.\n",
                            "example": 11
                          },
                          "workingTime": {
                            "type": "number",
                            "description": "Days **actually deducted** from the employee's balance: `duration` minus the bank holidays and non-working days inside the range. Equals the sum of `splitRequests[].workingTime`. When this is lower than `duration`, the days that were not deducted are the `splitRequests` entries whose `workingTime` is `0` - this field alone does not tell you which ones. For policies of type *Hour* the deduction is measured in minutes: see `splitRequests[].workingMinutes`.\n",
                            "example": 8
                          },
                          "_createdAt": {
                            "type": "string",
                            "description": "The date that the time-off request was created in format YYYY-MM-DDThh:mm:ss.",
                            "example": "2022-02-10T00:00:00"
                          },
                          "description": {
                            "type": "string",
                            "description": "The provided description on the time-off request.",
                            "example": "I'll take 8 days-off."
                          },
                          "hasAttachment": {
                            "type": "boolean",
                            "description": "Whether the request has files attached. `true` only means at least one attachment exists - neither the files nor their ids are exposed by this endpoint.\n",
                            "example": false
                          },
                          "_type": {
                            "type": "string",
                            "enum": [
                              "Submission",
                              "Request"
                            ],
                            "description": "This field defines if the request is a 'Submission' or a 'Request'. By default, the 'Submission' is automatically approved.",
                            "example": "Submission"
                          },
                          "splitRequests": {
                            "type": "array",
                            "description": "Day-by-day breakdown of the request: **one entry per calendar day** in the `from`-`to` range, in chronological order. This is the only field that tells you **which** days were actually deducted and which were not: a bank holiday or a non-working day appears here with `workingTime: 0`. The number of entries matches the request-level `duration`, and summing `workingTime` across them yields the request-level `workingTime` - so a request with `duration: 12` and `workingTime: 8` has 12 entries, 4 of them with `workingTime: 0`.\n",
                            "items": {
                              "type": "object",
                              "properties": {
                                "date": {
                                  "type": "string",
                                  "description": "The day this entry refers to, in format YYYY-MM-DDThh:mm:ss.",
                                  "example": "2022-01-31T00:00:00"
                                },
                                "workingTime": {
                                  "type": "number",
                                  "description": "Days actually deducted from the balance for this day. `0` when the day is a bank holiday or a non-working day - that is how you identify the days that did not count.\n",
                                  "example": 1
                                },
                                "workingMinutes": {
                                  "type": "number",
                                  "description": "Minutes actually deducted for this day, derived from the employee's work schedule. Use this instead of `workingTime` for policies of type *Hour*, where the balance is measured in minutes rather than days. `0` on days that were not deducted.\n",
                                  "example": 480
                                },
                                "partOfDay": {
                                  "type": "string",
                                  "enum": [
                                    "Morning",
                                    "Afternoon",
                                    "FullDay"
                                  ],
                                  "description": "Which part of this day was taken off. Only the first and last day of a range can be a half day, driven by the request-level `partOfDayFrom` and `partOfDayTo`; every day in between is `FullDay`.\n",
                                  "example": "FullDay"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "number",
                          "description": "The number of rows retrieved according the pagination filters (limit + offset)."
                        },
                        "offset": {
                          "type": "number",
                          "description": "The number of pages to skip. Determines the page number when pagination is being used."
                        },
                        "limit": {
                          "type": "number",
                          "description": "The maximum number of rows to retrieve. Determines the size of the page when pagination is being used."
                        },
                        "total": {
                          "type": "number",
                          "description": "The total number of rows existing for the provided filters."
                        }
                      }
                    }
                  },
                  "example": {
                    "data": [
                      {
                        "_id": "60a2db290da29e126a18789a",
                        "_userId": "80a2db290da29e126a18789b",
                        "_timeOffTypeId": "80a2db290da29e126a187809",
                        "_policyId": "80a2db290da29e126a187878",
                        "_policyName": "Sick days",
                        "_policyType": "Day",
                        "status": "Submitted",
                        "from": "2022-03-10T00:00:00",
                        "to": "2022-03-11T00:00:00",
                        "duration": 2,
                        "workingTime": 2,
                        "_createdAt": "2022-03-10T08:00:00",
                        "hasAttachment": true,
                        "_type": "Submission",
                        "splitRequests": [
                          {
                            "date": "2022-03-10T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-03-11T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          }
                        ]
                      },
                      {
                        "_id": "60a2db290da29e126a18789b",
                        "_userId": "80a2db290da29e126a18789b",
                        "_timeOffTypeId": "80a2db290da29e126a18789f",
                        "_policyId": "80a2db290da29e126a187897",
                        "_policyName": "Holidays for tech team",
                        "_policyType": "Day",
                        "status": "Submitted",
                        "from": "2022-02-01T00:00:00",
                        "to": "2022-02-12T00:00:00",
                        "duration": 12,
                        "workingTime": 8,
                        "_createdAt": "2022-02-01T10:30:00",
                        "description": "I have requested days off",
                        "hasAttachment": false,
                        "_type": "Submission",
                        "partOfDayFrom": "StartOfDay",
                        "partOfDayTo": "EndOfDay",
                        "splitRequests": [
                          {
                            "date": "2022-02-01T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-02T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-03T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-04T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-05T00:00:00",
                            "workingTime": 0,
                            "workingMinutes": 0,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-06T00:00:00",
                            "workingTime": 0,
                            "workingMinutes": 0,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-07T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-08T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-09T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-10T00:00:00",
                            "workingTime": 1,
                            "workingMinutes": 480,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-11T00:00:00",
                            "workingTime": 0,
                            "workingMinutes": 0,
                            "partOfDay": "FullDay"
                          },
                          {
                            "date": "2022-02-12T00:00:00",
                            "workingTime": 0,
                            "workingMinutes": 0,
                            "partOfDay": "FullDay"
                          }
                        ]
                      }
                    ],
                    "metadata": {
                      "count": 2,
                      "offset": 1,
                      "limit": 50,
                      "total": 2
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/badRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 106,
      "1": 218,
      "2": 6,
      "3": 37,
      "4": 185,
      "5": 237,
      "6": 157,
      "7": 30,
      "8": 73,
      "9": 86,
      "10": 56,
      "11": 44
    }
  }
}
```