# Humanity

> Manage employees, locations, positions, the shift schedule and leave requests in Humanity.

App · 29 actions. Web page: https://docs.lodol.com/docs/integrations/humanity

## Actions

### Approve a leave request

Approve a leave request.

**Inputs**

- Leave request ID (`leave_id`, number, required): The ID of the leave request to approve.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "admin": "example",
      "approved_on": "example",
      "comments": "example",
      "date": "example",
      "employee": {
        "id": "example",
        "name": "example"
      },
      "end_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "id": "example",
      "leave_type": "example",
      "notes": "example",
      "requested_on": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "start_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "status": "example",
      "user": "example"
    },
    "status": 1
  }
}
```

### Create a leave request

Request leave for an employee, for whole days or some hours.

**Inputs**

- Employee (`employee_id`, number, required): The employee taking leave.
- Leave type (`leave_type_id`, number, required): The type of leave.
- Start date (`start_date`, date, required): The first day of the leave.
- End date (`end_date`, date, required): The last day of the leave.
- Part of the day (`is_hourly`, true/false): Whether the leave is for some hours rather than whole days.
- Start time (`leave_start`, text): For leave of some hours, when it starts, as 24-hour HH:MM.
- End time (`leave_end`, text): For leave of some hours, when it ends, as 24-hour HH:MM.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "admin": "example",
      "approved_on": "example",
      "comments": "example",
      "date": "example",
      "employee": {
        "id": "example",
        "name": "example"
      },
      "end_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "id": "example",
      "leave_type": "example",
      "notes": "example",
      "requested_on": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "start_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "status": "example",
      "user": "example"
    },
    "status": 1
  }
}
```

### Create a location

Create a location or a remote site.

**Inputs**

- Name (`name`, text, required): The location's name.
- Type (`type`, text, required): A location where staff are scheduled, or a remote site where they work. One of: `location`, `remote_site` (Remote site).
- Address (`address`, text): The location's address.
- Country (`country`, text): The location's two-letter country code, such as US or NL.
- Copy positions from (`copy_location_id`, number): Another location whose positions the new one gets.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "address": "example",
      "country": "example",
      "id": "example",
      "lat": 1.0,
      "lon": 1.0,
      "map": "example",
      "name": "example",
      "notes": "example",
      "timezone_id": "example",
      "type": "example"
    },
    "status": 1
  }
}
```

### Create a position

Create a position.

**Inputs**

- Name (`name`, text, required): The position's name.
- Location (`location_id`, number): The location the position belongs to.
- Active (`active`, true/false): Whether the position can be scheduled.
- Visible to staff (`visible`, true/false): Whether staff can see the position's schedule.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "color": "example",
      "end_time": {
        "id": "example",
        "time": "example"
      },
      "id": "example",
      "job_code": "example",
      "location": {
        "id": "example",
        "name": "example"
      },
      "name": "example",
      "start_time": {
        "id": "example",
        "time": "example"
      },
      "visible": "example"
    },
    "status": 1
  }
}
```

### Create a shift

Add a shift to the schedule.

**Inputs**

- Position (`position_id`, number, required): The position the shift is in.
- Start date (`start_date`, date, required): The day the shift starts.
- Start time (`shift_start`, text, required): When the shift starts, as 24-hour HH:MM such as 09:00.
- End date (`end_date`, date, required): The day the shift ends.
- End time (`shift_end`, text, required): When the shift ends, as 24-hour HH:MM such as 17:00.
- Title (`title`, text): A title for the shift.
- Notes (`notes`, text): Notes on the shift that staff can see.
- Staff needed (`needed`, number): How many staff the shift needs. At least 0.
- Shift type (`shift_type`, text): A standard shift, or an open shift staff can pick up. One of: `standard`, `open`.
- Employees (`employee_ids`, list): The employees to assign.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "confirmed": "example",
      "created": "example",
      "edited": "example",
      "employees": [],
      "end_date": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "end_timestamp": "example",
      "id": "example",
      "length": 1.0,
      "location": "example",
      "needed": "example",
      "notes": "example",
      "published": "example",
      "schedule": "example",
      "schedule_name": "example",
      "start_date": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "start_timestamp": "example",
      "title": "example",
      "type": "example",
      "working": "example"
    },
    "status": 1
  }
}
```

### Create an employee

Add an employee.

**Inputs**

- First name (`first_name`, text, required): The employee's first name.
- Last name (`last_name`, text, required): The employee's last name.
- Email (`email`, text): The employee's email address.
- Mobile phone (`cell_phone`, text): The employee's mobile number.
- Home phone (`home_phone`, text): The employee's home phone number.
- Employee ID (`eid`, text): Your own ID for the employee, such as their payroll number.
- Job title (`job_title`, text): The employee's job title.
- Permission level (`group`, text): What the employee can do in Humanity, from manager to schedule viewer. One of: `manager`, `supervisor`, `scheduler`, `employee`, `accountant`, `schedule_viewer` (Schedule viewer).
- Location (`location_id`, number): The employee's location.
- Address (`address`, text): The employee's street address.
- City (`city`, text): The employee's city.
- State (`state`, text): The employee's state or region.
- Postcode (`zip`, text): The employee's postcode or ZIP code.
- Start date (`work_start_date`, date): The day the employee started work.
- Notes (`notes`, text): Notes about the employee.
- Positions (`position_ids`, list): The positions the employee can be scheduled in.
- Send activation email (`send_activation`, true/false): Whether to email the employee an invitation to activate their account.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "address": "example",
      "cell_phone": "example",
      "city": "example",
      "eid": "example",
      "email": "example",
      "firstname": "example",
      "group": "example",
      "group_name": "example",
      "home_phone": "example",
      "id": "example",
      "last_active": "example",
      "lastname": "example",
      "location": "example",
      "name": "example",
      "nick_name": "example",
      "notes": "example",
      "registered": "example",
      "schedules": {},
      "skills": {},
      "state": "example",
      "status": "example",
      "status_name": "example",
      "timezone_name": "example",
      "username": "example",
      "work_start_date": "example",
      "zip": "example"
    },
    "status": 1
  }
}
```

### Delete a leave request

Delete a leave request.

**Inputs**

- Leave request ID (`leave_id`, number, required): The ID of the leave request to delete.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": "example",
    "status": 1
  }
}
```

### Delete a location

Delete a location or remote site.

**Inputs**

- Location (`location_id`, number, required): The location to delete.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": "example",
    "status": 1
  }
}
```

### Delete a position

Delete a position.

**Inputs**

- Position (`position_id`, number, required): The position to delete.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": "example",
    "status": 1
  }
}
```

### Delete a shift

Delete a shift from the schedule.

**Inputs**

- Shift ID (`shift_id`, number, required): The ID of the shift to delete.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": "example",
    "status": 1
  }
}
```

### Delete an employee

Delete an employee's account.

**Inputs**

- Employee (`employee_id`, number, required): The employee to delete.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": "example",
    "status": 1
  }
}
```

### Get a leave request

Get a leave request.

**Inputs**

- Leave request ID (`leave_id`, number, required): The ID of the leave request.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "admin": "example",
      "approved_on": "example",
      "comments": "example",
      "date": "example",
      "employee": {
        "id": "example",
        "name": "example"
      },
      "end_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "id": "example",
      "leave_type": "example",
      "notes": "example",
      "requested_on": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "start_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "status": "example",
      "user": "example"
    },
    "status": 1
  }
}
```

### Get a location

Get a location's details.

**Inputs**

- Location (`location_id`, number, required): The location to get.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "address": "example",
      "country": "example",
      "id": "example",
      "lat": 1.0,
      "lon": 1.0,
      "map": "example",
      "name": "example",
      "notes": "example",
      "timezone_id": "example",
      "type": "example"
    },
    "status": 1
  }
}
```

### Get a position

Get a position's details.

**Inputs**

- Position (`position_id`, number, required): The position to get.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "color": "example",
      "end_time": {
        "id": "example",
        "time": "example"
      },
      "id": "example",
      "job_code": "example",
      "location": {
        "id": "example",
        "name": "example"
      },
      "name": "example",
      "start_time": {
        "id": "example",
        "time": "example"
      },
      "visible": "example"
    },
    "status": 1
  }
}
```

### Get a shift

Get a shift's details.

**Inputs**

- Shift ID (`shift_id`, number, required): The ID of the shift.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "confirmed": "example",
      "created": "example",
      "edited": "example",
      "employees": [],
      "end_date": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "end_timestamp": "example",
      "id": "example",
      "length": 1.0,
      "location": "example",
      "needed": "example",
      "notes": "example",
      "published": "example",
      "schedule": "example",
      "schedule_name": "example",
      "start_date": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "start_timestamp": "example",
      "title": "example",
      "type": "example",
      "working": "example"
    },
    "status": 1
  }
}
```

### Get an employee

Get an employee's details.

**Inputs**

- Employee (`employee_id`, number, required): The employee to get.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "address": "example",
      "cell_phone": "example",
      "city": "example",
      "eid": "example",
      "email": "example",
      "firstname": "example",
      "group": "example",
      "group_name": "example",
      "home_phone": "example",
      "id": "example",
      "last_active": "example",
      "lastname": "example",
      "location": "example",
      "name": "example",
      "nick_name": "example",
      "notes": "example",
      "registered": "example",
      "schedules": {},
      "skills": {},
      "state": "example",
      "status": "example",
      "status_name": "example",
      "timezone_name": "example",
      "username": "example",
      "work_start_date": "example",
      "zip": "example"
    },
    "status": 1
  }
}
```

### Get my account

Get the Humanity account the connection signs in as.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "address": "example",
      "cell_phone": "example",
      "city": "example",
      "eid": "example",
      "email": "example",
      "firstname": "example",
      "group": "example",
      "group_name": "example",
      "home_phone": "example",
      "id": "example",
      "last_active": "example",
      "lastname": "example",
      "location": "example",
      "name": "example",
      "nick_name": "example",
      "notes": "example",
      "registered": "example",
      "schedules": {},
      "skills": {},
      "state": "example",
      "status": "example",
      "status_name": "example",
      "timezone_name": "example",
      "username": "example",
      "work_start_date": "example",
      "zip": "example"
    },
    "status": 1
  }
}
```

### List employees

List employees, optionally only those at a location or in a position.

**Inputs**

- Location (`location_id`, number): Only employees at this location.
- Position (`position_id`, number): Only employees in this position.
- Disabled employees only (`include_disabled`, true/false): Return disabled employees instead.
- Inactive employees only (`include_inactive`, true/false): Return employees who haven't activated their account instead.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": [],
    "status": 1
  }
}
```

### List leave requests

List leave requests in a date range.

**Inputs**

- Start date (`start_date`, date): The first day to look in.
- End date (`end_date`, date): The last day to look in.
- View (`mode`, text): Which requests to list: those you manage, your own, upcoming ones, or every request. One of: `manage`, `requested`, `upcoming`, `all_requested` (All requested).
- Employee (`employee_id`, number): Only this employee's requests.
- Page (`page`, number): Which page of up to 100 requests to return, starting at 1. At least 1.
- Limit (`limit`, number): How many requests to return per page, at most 100. From 1 to 100.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": [],
    "status": 1
  }
}
```

### List leave types

List the leave types, such as vacation or sick leave.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": [],
    "status": 1
  }
}
```

### List locations

List locations and remote sites.

**Inputs**

- Type (`type`, text): Only locations or only remote sites. One of: `location`, `remote_site` (Remote site).

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": [],
    "status": 1
  }
}
```

### List positions

List positions, the roles shifts are scheduled in.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": [],
    "status": 1
  }
}
```

### List shifts

List shifts in a date range.

**Inputs**

- Start date (`start_date`, date): The first day to look in.
- End date (`end_date`, date): The last day to look in.
- View (`mode`, text): Which shifts to list: overview is every shift; employee is only yours; open is unfilled shifts; upcoming and recent are an employee's next or last shifts. One of: `overview`, `location`, `schedule`, `employees`, `employee`, `open`, `openapproval`, `confirm`, `onnow`, `late`, `upcoming`, `recent`. Default: `overview`.
- Positions (`position_ids`, list): Only shifts in these positions, for the location, schedule, employees and confirm views.
- Employees (`employee_ids`, list): Only these employees' shifts, for the employees and confirm views.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": [],
    "status": 1
  }
}
```

### List skills

List the skills employees can have.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": [],
    "status": 1
  }
}
```

### Reject a leave request

Reject a leave request.

**Inputs**

- Leave request ID (`leave_id`, number, required): The ID of the leave request to reject.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "admin": "example",
      "approved_on": "example",
      "comments": "example",
      "date": "example",
      "employee": {
        "id": "example",
        "name": "example"
      },
      "end_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "id": "example",
      "leave_type": "example",
      "notes": "example",
      "requested_on": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "start_day": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "status": "example",
      "user": "example"
    },
    "status": 1
  }
}
```

### Update a location

Change a location's details.

**Inputs**

- Location (`location_id`, number, required): The location to update.
- Name (`name`, text, required): The location's name.
- Address (`address`, text): The location's address.
- Country (`country`, text): The location's two-letter country code.
- Phone number (`phone_number`, text): The location's phone number.
- Notes (`notes`, text): Notes about the location.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "address": "example",
      "country": "example",
      "id": "example",
      "lat": 1.0,
      "lon": 1.0,
      "map": "example",
      "name": "example",
      "notes": "example",
      "timezone_id": "example",
      "type": "example"
    },
    "status": 1
  }
}
```

### Update a position

Change a position. Only the fields you fill in are changed.

**Inputs**

- Position (`position_id`, number, required): The position to update.
- Name (`name`, text): The position's name.
- Location (`location_id`, number): The location the position belongs to.
- Active (`active`, true/false): Whether the position can be scheduled.
- Visible to staff (`visible`, true/false): Whether staff can see the position's schedule.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "color": "example",
      "end_time": {
        "id": "example",
        "time": "example"
      },
      "id": "example",
      "job_code": "example",
      "location": {
        "id": "example",
        "name": "example"
      },
      "name": "example",
      "start_time": {
        "id": "example",
        "time": "example"
      },
      "visible": "example"
    },
    "status": 1
  }
}
```

### Update a shift

Change a shift, or assign or remove employees.

**Inputs**

- Shift ID (`shift_id`, number, required): The ID of the shift to update.
- Position (`position_id`, number): The position the shift is in. Leave empty to keep it.
- Start date (`start_date`, date): The day the shift starts. Leave empty to keep it.
- Start time (`shift_start`, text): When the shift starts, as 24-hour HH:MM such as 09:00. Leave empty to keep it.
- End date (`end_date`, date): The day the shift ends. Leave empty to keep it.
- End time (`shift_end`, text): When the shift ends, as 24-hour HH:MM such as 17:00. Leave empty to keep it.
- Title (`title`, text): A title for the shift.
- Notes (`notes`, text): Notes on the shift that staff can see.
- Staff needed (`needed`, number): How many staff the shift needs. At least 0.
- Shift type (`shift_type`, text): A standard shift, or an open shift staff can pick up. One of: `standard`, `open`.
- Add employees (`add_employee_ids`, list): Employees to assign to the shift.
- Remove employees (`remove_employee_ids`, list): Employees to take off the shift.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "confirmed": "example",
      "created": "example",
      "edited": "example",
      "employees": [],
      "end_date": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "end_timestamp": "example",
      "id": "example",
      "length": 1.0,
      "location": "example",
      "needed": "example",
      "notes": "example",
      "published": "example",
      "schedule": "example",
      "schedule_name": "example",
      "start_date": {
        "date": "example",
        "formatted": "example",
        "iso8601": "example",
        "time": "example",
        "timestamp": 1
      },
      "start_timestamp": "example",
      "title": "example",
      "type": "example",
      "working": "example"
    },
    "status": 1
  }
}
```

### Update an employee

Change an employee's details. Only the fields you fill in are changed.

**Inputs**

- Employee (`employee_id`, number, required): The employee to update.
- First name (`first_name`, text): The employee's first name.
- Last name (`last_name`, text): The employee's last name.
- Email (`email`, text): The employee's email address.
- Mobile phone (`cell_phone`, text): The employee's mobile number.
- Home phone (`home_phone`, text): The employee's home phone number.
- Employee ID (`eid`, text): Your own ID for the employee, such as their payroll number.
- Job title (`job_title`, text): The employee's job title.
- Permission level (`group`, text): What the employee can do in Humanity, from manager to schedule viewer. One of: `manager`, `supervisor`, `scheduler`, `employee`, `accountant`, `schedule_viewer` (Schedule viewer).
- Location (`location_id`, number): The employee's location.
- Address (`address`, text): The employee's street address.
- City (`city`, text): The employee's city.
- State (`state`, text): The employee's state or region.
- Postcode (`zip`, text): The employee's postcode or ZIP code.
- Start date (`work_start_date`, date): The day the employee started work.
- Notes (`notes`, text): Notes about the employee.
- Add positions (`add_position_ids`, list): Positions to assign the employee to.
- Remove positions (`remove_position_ids`, list): Positions to take the employee off.
- Status (`status`, text): Whether the employee's account is active. One of: `activated`, `deactivated`, `disabled`.

**Outputs**

- `data` (object): The response from Humanity.

**Example output**

```json
{
  "data": {
    "data": {
      "address": "example",
      "cell_phone": "example",
      "city": "example",
      "eid": "example",
      "email": "example",
      "firstname": "example",
      "group": "example",
      "group_name": "example",
      "home_phone": "example",
      "id": "example",
      "last_active": "example",
      "lastname": "example",
      "location": "example",
      "name": "example",
      "nick_name": "example",
      "notes": "example",
      "registered": "example",
      "schedules": {},
      "skills": {},
      "state": "example",
      "status": "example",
      "status_name": "example",
      "timezone_name": "example",
      "username": "example",
      "work_start_date": "example",
      "zip": "example"
    },
    "status": 1
  }
}
```
