Skip to Content
PeopleForce
Leaves

Deprecated

Company API v1 is deprecated. It no longer receives changes and will stop being supported, so move integrations to Company API v3.

Create a leave request

Deprecated

POST
/api/public/v1/leave_requests

Request Body

application/x-www-form-urlencoded
  1. body
employee_id*string
leave_type_id*string
starts_on*string
Formatdate
ends_on*string
Formatdate
description*string
leave_request_entries*array<>
skip_approval*string

Response Body

The created leave request.

application/json
  1. response
data*
Example Request
curl -X POST 'https://app.peopleforce.io/api/public/v1/leave_requests' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'employee_id=string&leave_type_id=string&starts_on=2019-08-24&ends_on=2019-08-24&description=string&leave_request_entries=%7B%22occurs_on%22%3A%222019-08-24%22%2C%22amount%22%3A%22string%22%7D&skip_approval=string'
Example Response
{  "data": {    "id": 0,    "employee_id": 0,    "leave_type_id": 0,    "leave_type": "string",    "state": "pending",    "amount": "string",    "hours": "string",    "tracking_time_in": "hours",    "starts_on": "2019-08-24",    "ends_on": "2019-08-24",    "comment": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "attachment_url": "string",    "employee": {      "id": 0,      "first_name": "string",      "last_name": "string",      "email": "string"    },    "entries": [      {        "date": "2019-08-24",        "amount": "string",        "starts_at": "2019-08-24T14:15:22Z",        "ends_at": "2019-08-24T14:15:22Z"      }    ],    "leave_type_policy": {      "name": "string",      "visibility": "public",      "activity_type": "not_working_paid"    },    "approvals": [      {        "state": "queued",        "assigned_to": {          "id": 0,          "full_name": "string"        }      }    ]  }}