---
updatedAt: 2026-05-14T14:32:15.000Z
agentTools:
  projectIndex: https://docs.oysterhr.com/v0.1/llms.txt
---

# Create time off request

This API endpoint allows you to create a new time off request record and receive a complete response with the created record details.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Endpoints",
    "version": "v0.1"
  },
  "components": {
    "securitySchemes": {
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "timeOffEngagementDetails": {
        "type": "object",
        "properties": {
          "engagementId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "pattern": "^[a-z_]+$"
          },
          "countryCode": {
            "type": "string"
          }
        },
        "required": [
          "engagementId",
          "name",
          "type",
          "countryCode"
        ]
      },
      "timeOffRequest": {
        "type": "object",
        "properties": {
          "timeOffRequestId": {
            "type": "string"
          },
          "engagement": {
            "$ref": "#/components/schemas/timeOffEngagementDetails"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "state": {
            "type": "string",
            "pattern": "^[a-z_]+$"
          },
          "timeOffType": {
            "type": "string",
            "pattern": "^[a-z_]+$"
          },
          "requesterComments": {
            "type": "string",
            "nullable": true
          },
          "rejectionReason": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "pattern": "^[a-z_]+$"
          },
          "periodInHours": {
            "type": "number",
            "format": "float"
          }
        },
        "required": [
          "timeOffRequestId",
          "engagement",
          "startDate",
          "endDate",
          "state",
          "timeOffType",
          "requesterComments",
          "rejectionReason",
          "reason",
          "periodInHours"
        ]
      }
    }
  },
  "paths": {
    "/v0.1/time_off/requests": {
      "post": {
        "summary": "Create time off request",
        "tags": [
          "Time Off",
          "time_off",
          "@oysterhr/prepay"
        ],
        "description": "This API endpoint allows you to create a new time off request record and receive a complete response with the created record details.",
        "security": [
          {
            "bearer_auth": [
              "manage"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully created time off request in hours",
            "content": {
              "application/json": {
                "examples": {
                  "Successfully created time off request": {
                    "value": {
                      "data": {
                        "timeOffRequestId": "Abce6d0f",
                        "engagement": {
                          "engagementId": "A5540727",
                          "name": "Rosendo Barrows CPA",
                          "type": "employment",
                          "countryCode": "PL"
                        },
                        "startDate": "2022-10-14",
                        "endDate": "2022-10-14",
                        "startDateTimePeriod": "full_day",
                        "endDateTimePeriod": null,
                        "startDateHours": null,
                        "endDateHours": null,
                        "state": "submitted",
                        "timeOffType": "vacation",
                        "requesterComments": null,
                        "rejectionReason": null,
                        "reason": "paid_time_off",
                        "periodInHours": 8
                      }
                    }
                  },
                  "Successfully created time off request in hours": {
                    "value": {
                      "data": {
                        "timeOffRequestId": "Abce6d0f",
                        "engagement": {
                          "engagementId": "A5540727",
                          "name": "Rosendo Barrows CPA",
                          "type": "employment",
                          "countryCode": "PL"
                        },
                        "startDate": "2022-10-14",
                        "endDate": "2022-10-15",
                        "startDateTimePeriod": null,
                        "endDateTimePeriod": null,
                        "startDateHours": 8,
                        "endDateHours": 8,
                        "state": "submitted",
                        "timeOffType": "vacation",
                        "requesterComments": null,
                        "rejectionReason": null,
                        "reason": "paid_time_off",
                        "periodInHours": 8
                      }
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/timeOffRequest"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "examples": {
                  "Unprocessable entity": {
                    "value": {
                      "errors": [
                        {
                          "message": "Reason is invalid for the specified time off type"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "engagementId": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[\\w+\\-]{8,9}$"
                  },
                  "startDate": {
                    "type": "string",
                    "format": "date",
                    "minLength": 1
                  },
                  "endDate": {
                    "type": "string",
                    "format": "date",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "enum": [
                      "VACATION",
                      "SICK_LEAVE",
                      "UNPAID_LEAVE",
                      "OTHER"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "enum": [
                      "PAID_TIME_OFF",
                      "UNPAID_TIME_OFF",
                      "PARENTAL_LEAVE",
                      "CAREGIVER_LEAVE",
                      "EDUCATIONAL_LEAVE",
                      "MARRIAGE_LEAVE",
                      "MILITARY_TRAINING_ASSEMBLY",
                      "MILITARY_MEDICAL_EXAMINATION",
                      "MILITARY_PAID_LEAVE",
                      "SABBATICAL",
                      "CIVIC_DUTIES",
                      "BEREAVEMENT",
                      "TIME_OFF_IN_LIEU",
                      "LOCAL_HOLIDAY",
                      "OTHER_PAID_LEAVE",
                      "MILITARY_UNPAID_LEAVE",
                      "RELIGIOUS_OBSERVANCE",
                      "OTHER_UNPAID_LEAVE"
                    ]
                  },
                  "requestByAdmin": {
                    "type": "boolean",
                    "description": "This parameter shows whether the time off was requested by the Company Admin. If it's set to false, it means the request came from the Team Member."
                  },
                  "startDateTimePeriod": {
                    "type": "string",
                    "minLength": 1,
                    "enum": [
                      "FULL_DAY",
                      "MORNING",
                      "AFTERNOON"
                    ]
                  },
                  "endDateTimePeriod": {
                    "type": "string",
                    "minLength": 1,
                    "enum": [
                      "FULL_DAY",
                      "MORNING"
                    ]
                  },
                  "startDateHours": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 8
                  },
                  "endDateHours": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 8
                  },
                  "requesterComments": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "engagementId",
                  "startDate",
                  "endDate",
                  "type",
                  "reason",
                  "requestByAdmin"
                ]
              },
              "examples": {
                "Successfully created time off request": {
                  "summary": "Successfully created time off request",
                  "value": {
                    "engagementId": "A5540727",
                    "startDate": "2022-10-14",
                    "endDate": "2022-10-14",
                    "type": "VACATION",
                    "reason": "PAID_TIME_OFF",
                    "startDateTimePeriod": "FULL_DAY",
                    "requestByAdmin": true
                  }
                },
                "Successfully created time off request in hours": {
                  "summary": "Successfully created time off request in hours",
                  "value": {
                    "engagementId": "A5540727",
                    "startDate": "2022-10-14",
                    "endDate": "2022-10-15",
                    "type": "VACATION",
                    "reason": "PAID_TIME_OFF",
                    "startDateHours": 8,
                    "endDateHours": 8,
                    "requestByAdmin": true
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.oysterhr.com",
      "description": "Production server"
    },
    {
      "url": "https://api-sandbox.oysterhr.com",
      "description": "Sandbox server"
    }
  ]
}
```