# Planday

> Manage employees, departments and the shift schedule, and handle absence requests in Planday.

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

## Actions

### Approve an absence request

Approve an employee's absence request.

**Inputs**

- Absence request ID (`absence_request_id`, number, required): The ID of the absence request to approve.
- Reason (`reason`, text): A note for the employee.
- Notify the employee (`notify`, true/false): Whether to tell the employee.
- Their shifts in the period (`existing_shifts`, text): What to do with the employee's shifts during the absence. Leave empty for the portal's default. One of: `NoAction`, `Delete`, `ChangeShiftType`.
- Cover shifts (`cover_shifts`, text): Whether to create open shifts to cover the absence. Leave empty for the portal's default. One of: `DoNotCreate`, `CreateOpen`.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Create a department

Create a department.

**Inputs**

- Name (`name`, text, required): The department's name.
- Number (`number`, text): The department's number or code.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "id": 1,
      "name": "example",
      "number": "example"
    }
  }
}
```

### Create a shift

Add a shift to the schedule.

**Inputs**

- Department (`department_id`, number, required): The department the shift belongs to.
- Date (`date`, date, required): The day in the schedule the shift belongs to.
- Start time (`shift_start`, text): When the shift starts, as 24-hour HH:MM in the department's time zone, such as 09:00.
- End time (`shift_end`, text): When the shift ends, as 24-hour HH:MM, at most 24 hours after the start.
- Employee (`employee_id`, number): The employee to assign. Leave empty for an open shift.
- Employee group (`employee_group_id`, number): The employee group (role in the schedule) the shift is for.
- Position (`position_id`, number): The schedule position the shift is for.
- Shift type (`shift_type_id`, number): The shift type, such as normal or overtime.
- Comment (`comment`, text): A comment on the shift that managers and employees can see.
- Add default breaks (`use_breaks`, true/false): Whether to add the breaks set up in your break settings. Default: `true`.
- Allow conflicts (`allow_conflicts`, true/false): Whether to save the shift even if it conflicts with the employee's other shifts or rules. Default: `false`.
- Draft (`is_draft`, true/false): Whether the shift is a draft that employees can't see until it's published.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "comment": "example",
      "date": "example",
      "defaultWage": {
        "amount": 1.0,
        "type": "example"
      },
      "departmentId": 1,
      "employeeGroupId": 1,
      "employeeId": 1,
      "endTime": "example",
      "id": 1,
      "isDraft": false,
      "manualBreaks": [],
      "positionId": 1,
      "shiftTypeId": 1,
      "skillIds": [],
      "startTime": "example",
      "timeZone": "example"
    }
  }
}
```

### Create an employee

Create an employee. Your portal may require more fields.

**Inputs**

- First name (`first_name`, text, required): The employee's first name.
- Last name (`last_name`, text, required): The employee's last name.
- Departments (`department_ids`, list, required): The departments the employee works in.
- Username (`user_name`, text): The email address the employee signs in with. Leave it and Email empty to create a draft employee you invite later.
- Email (`email`, text): The employee's main email address.
- Cell phone (`cell_phone`, text): The employee's mobile phone number.
- Cell phone country (`cell_phone_country_code`, text): The two-letter country code of the mobile number, such as DK or GB.
- Phone (`phone`, text): Another phone number for the employee.
- Street address (`street1`, text): The first line of the employee's address.
- Address line 2 (`street2`, text): The second line of the employee's address.
- Postcode (`zip`, text): The postcode or ZIP code of the employee's address.
- City (`city`, text): The city of the employee's address.
- Employee groups (`employee_group_ids`, list): The employee groups (roles in the schedule) the employee belongs to.
- Employee type (`employee_type_id`, number): The employee type, such as full time or hourly.
- Primary department (`primary_department_id`, number): The employee's main department, on portals where this field is turned on.
- Hired from (`hired_from`, date): The date the employee was hired.
- Birth date (`birth_date`, date): The employee's date of birth.
- Gender (`gender`, text): The employee's gender. One of: `Male`, `Female`.
- Job title (`job_title`, text): The employee's job title.
- Salary identifier (`salary_identifier`, text): The employee's salary code, used by payroll.
- Hours per month (`work_hours`, number): The hours the employee is contracted to work each month. At least 0.
- Visible to colleagues (`is_public`, true/false): Whether other employees can see this employee's details.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "bankAccount": {
        "accountNumber": "example",
        "registrationNumber": "example"
      },
      "birthDate": "example",
      "cellPhone": "example",
      "cellPhoneCountryCode": "example",
      "city": "example",
      "contractRulesRuleId": 1,
      "countryId": 1,
      "dateTimeCreated": "example",
      "dateTimeModified": "example",
      "deactivationDate": "example",
      "departments": [],
      "email": "example",
      "employeeGroups": [],
      "employeeTypeId": 1,
      "firstName": "example",
      "gender": "example",
      "hiredFrom": "example",
      "id": 1,
      "isPublic": false,
      "isSupervisor": false,
      "jobTitle": "example",
      "lastName": "example",
      "phone": "example",
      "phoneCountryCode": "example",
      "primaryDepartmentId": 1,
      "salaryIdentifier": "example",
      "securityGroups": [],
      "skillIds": [],
      "ssn": "example",
      "street1": "example",
      "street2": "example",
      "supervisorEmployeeId": 1,
      "supervisorId": 1,
      "userName": "example",
      "workHours": 1.0,
      "zip": "example"
    }
  }
}
```

### Create an employee group

Create an employee group.

**Inputs**

- Name (`name`, text, required): The employee group's name.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "id": 1,
      "name": "example"
    }
  }
}
```

### Deactivate an employee

Remove an employee's access, now or from a date. Their profile is kept and can be reactivated.

**Inputs**

- Employee (`employee_id`, number, required): The employee to deactivate.
- Last active date (`date`, date): The last day the employee is active. Leave empty to deactivate them now.
- Reason (`reason`, text): A note on why, shown in the employee's details.
- Termination type (`termination_type_id`, number): The termination type, if your portal requires one.
- Keep shifts (`keep_shifts`, true/false): Whether to keep the employee on shifts after their last day. Otherwise they're taken off those shifts.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Delete a department

Delete a department. This can't be undone.

**Inputs**

- Department (`department_id`, number, required): The department to delete.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Delete a shift

Delete a shift from the schedule. This can't be undone.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Delete an employee group

Delete an employee group. This can't be undone.

**Inputs**

- Employee group (`employee_group_id`, number, required): The employee group to delete. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Deny an absence request

Deny an absence request that is still waiting for a decision.

**Inputs**

- Absence request ID (`absence_request_id`, number, required): The ID of the absence request to deny.
- Reason (`reason`, text): A note for the employee.
- Notify the employee (`notify`, true/false): Whether to tell the employee.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Get a department

Get a department's details.

**Inputs**

- Department (`department_id`, number, required): The department to get.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "id": 1,
      "name": "example",
      "number": "example"
    }
  }
}
```

### Get a shift

Get a shift's details.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "comment": "example",
      "date": "example",
      "dateTimeCreated": "example",
      "dateTimeModified": "example",
      "departmentId": 1,
      "employeeGroupId": 1,
      "employeeId": 1,
      "endDateTime": "example",
      "id": 1,
      "manualBreaks": [],
      "positionId": 1,
      "punchClockShiftId": 1,
      "shiftTypeId": 1,
      "skillIds": [],
      "startDateTime": "example",
      "status": "Open",
      "timeZone": "example"
    }
  }
}
```

### Get an employee

Get an employee's profile.

**Inputs**

- Employee (`employee_id`, number, required): The employee to get.
- Sensitive fields (`special`, list): Sensitive fields to include in the answer, if your access allows it: bank account, birth date or social security number. One or more of: `BankAccount`, `BirthDate`, `Ssn`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "bankAccount": {
        "accountNumber": "example",
        "registrationNumber": "example"
      },
      "birthDate": "example",
      "cellPhone": "example",
      "cellPhoneCountryCode": "example",
      "cellPhoneCountryPrefix": "example",
      "city": "example",
      "contractRulesRuleId": 1,
      "countryId": 1,
      "dateTimeCreated": "example",
      "dateTimeModified": "example",
      "deactivationDate": "example",
      "deactivationReason": "example",
      "departments": [],
      "email": "example",
      "employeeGroups": [],
      "employeeTypeId": 1,
      "firstName": "example",
      "gender": "example",
      "hiredFrom": "example",
      "id": 1,
      "isDeactivated": false,
      "isPublic": false,
      "jobTitle": "example",
      "lastName": "example",
      "phone": "example",
      "phoneCountryCode": "example",
      "phoneCountryPrefix": "example",
      "primaryDepartmentId": 1,
      "salaryIdentifier": "example",
      "securityGroups": [],
      "skillIds": [],
      "ssn": "example",
      "street1": "example",
      "street2": "example",
      "supervisorEmployeeId": 1,
      "supervisorId": 1,
      "terminationTypeId": 1,
      "terminationTypeName": "example",
      "userName": "example",
      "workHours": 1.0,
      "zip": "example"
    }
  }
}
```

### List absence requests

List absence requests, filtered by employee, status and dates.

**Inputs**

- Offset (`offset`, number): How many requests to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many requests to return. At least 1.
- Employee (`employee_id`, number): Only this employee's requests.
- Statuses (`status`, list): Only requests with these statuses. One or more of: `Submitted`, `Declined`, `Approved`, `Cancelled`.
- Start date (`start_date`, date): Only time off ending on or after this date.
- End date (`end_date`, date): Only time off starting on or before this date.
- Changed on or after (`modified_from`, date): Only requests created or changed on or after this date.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List deactivated employees

List employees whose access has been removed.

**Inputs**

- Offset (`offset`, number): How many records to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many records to return, at most 50. From 1 to 50.
- Search (`search_query`, text): Text to match against first name, last name, email, phone number or salary identifier.
- Deactivated after (`deactivated_from`, date and time): Only employees deactivated after this time.
- Deactivated before (`deactivated_to`, date and time): Only employees deactivated before this time.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List departments

List the portal's departments.

**Inputs**

- Offset (`offset`, number): How many records to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many records to return, at most 50. From 1 to 50.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List employee groups

List the employee groups, the roles employees fill in the schedule.

**Inputs**

- Offset (`offset`, number): How many records to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many records to return, at most 50. From 1 to 50.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List employee types

List the employee types set up in the portal.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List employees

List active employees, optionally filtered by when they were created or changed, or by a search.

**Inputs**

- Offset (`offset`, number): How many records to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many records to return, at most 50. From 1 to 50.
- Search (`search_query`, text): Text to match against first name, last name, email, phone number or salary identifier.
- Created after (`created_from`, date and time): Only employees created after this time.
- Created before (`created_to`, date and time): Only employees created before this time.
- Changed after (`modified_from`, date and time): Only employees created, changed or deactivated after this time.
- Changed before (`modified_to`, date and time): Only employees created, changed or deactivated before this time.
- Sensitive fields (`special`, list): Sensitive fields to include in the answer, if your access allows it: bank account, birth date or social security number. One or more of: `BankAccount`, `BirthDate`, `Ssn`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List positions

List the schedule positions.

**Inputs**

- Offset (`offset`, number): How many records to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many records to return, at most 50. From 1 to 50.
- Active (`is_active`, true/false): Only active positions, or only inactive ones.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List punch clock records

List the times employees punched in and out in a period.

**Inputs**

- From (`period_start`, date and time, required): The start of the period.
- To (`period_end`, date and time, required): The end of the period.
- Employee (`employee_id`, number): Only this employee's records.
- Shift ID (`shift_id`, number): Only records for this shift.
- Offset (`offset`, number): How many records to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many records to return. At least 1.

**Outputs**

- `data` (object): Custom paged response wrapper for Open API

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List shift types

List the shift types.

**Inputs**

- Offset (`offset`, number): How many records to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many records to return, at most 50. From 1 to 50.
- Active (`is_active`, true/false): Only active shift types, or only inactive ones.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List shifts

List shifts, filtered by date, department, employee, status and more.

**Inputs**

- Offset (`offset`, number): How many shifts to skip, for paging. Starts at 0. At least 0.
- Limit (`limit`, number): How many shifts to return, at most 5,000. From 1 to 5000.
- From (`from_date`, date): Only shifts on or after this date.
- To (`to_date`, date): Only shifts on or before this date.
- Departments (`department_ids`, list): Only shifts in these departments.
- Employees (`employee_ids`, list): Only shifts assigned to these employees.
- Employee groups (`employee_group_ids`, list): Only shifts for these employee groups.
- Positions (`position_ids`, list): Only shifts for these positions.
- Shift types (`shift_type_ids`, list): Only shifts of these types.
- Status (`shift_status`, text): Only shifts with this status. One of: `Open`, `Assigned`, `Approved`, `ForSale`, `Draft`, `OnDuty`, `PendingSwapAcceptance`, `PendingApproval`, `PunchclockStarted`, `PunchclockFinished`, `PunchclockApproved`.
- Created after (`created_from`, date and time): Only shifts created after this time.
- Changed after (`modified_from`, date and time): Only shifts changed after this time.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List termination types

List the termination types an employee can be deactivated with.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### Reactivate an employee

Give a deactivated employee their access back now.

**Inputs**

- Employee (`employee_id`, number, required): The deactivated employee to reactivate.
- Comment (`comment`, text): A note about the reactivation.
- Departments (`department_ids`, list): The departments to put the employee back in.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Rename an employee group

Rename an employee group.

**Inputs**

- Employee group (`employee_group_id`, number, required): The employee group to rename. At least 1.
- Name (`name`, text, required): The new name.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Update a department

Rename a department or change its number.

**Inputs**

- Department (`department_id`, number, required): The department to update.
- Name (`name`, text, required): The department's name.
- Number (`number`, text): The department's number or code. Leave empty to clear it.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Update a shift

Change a shift. Fields you leave empty keep their current values.

**Inputs**

- Shift ID (`shift_id`, number, required): The ID of the shift to update. At least 1.
- Date (`date`, date): The day in the schedule the shift belongs to. Leave empty to keep the shift's date.
- Start time (`shift_start`, text): When the shift starts, as 24-hour HH:MM in the department's time zone, such as 09:00. Leave empty to keep it.
- End time (`shift_end`, text): When the shift ends, as 24-hour HH:MM, at most 24 hours after the start. Leave empty to keep it.
- Employee (`employee_id`, number): The employee to assign. Leave empty to keep the current one.
- Employee group (`employee_group_id`, number): The employee group (role in the schedule) the shift is for.
- Position (`position_id`, number): The schedule position the shift is for.
- Shift type (`shift_type_id`, number): The shift type, such as normal or overtime.
- Comment (`comment`, text): A comment on the shift that managers and employees can see.
- Add default breaks (`use_breaks`, true/false): Whether to add the breaks set up in your break settings. Default: `true`.
- Allow conflicts (`allow_conflicts`, true/false): Whether to save the shift even if it conflicts with the employee's other shifts or rules. Default: `false`.
- Draft (`is_draft`, true/false): Whether the shift is a draft that employees can't see until it's published.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "comment": "example",
      "date": "example",
      "defaultWage": {
        "amount": 1.0,
        "type": "example"
      },
      "departmentId": 1,
      "employeeGroupId": 1,
      "employeeId": 1,
      "endTime": "example",
      "id": 1,
      "isDraft": false,
      "manualBreaks": [],
      "positionId": 1,
      "shiftTypeId": 1,
      "skillIds": [],
      "startTime": "example",
      "timeZone": "example"
    }
  }
}
```

### 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.
- Departments (`department_ids`, list): The departments the employee works in.
- Username (`user_name`, text): The email address the employee signs in with.
- Email (`email`, text): The employee's main email address.
- Cell phone (`cell_phone`, text): The employee's mobile phone number.
- Cell phone country (`cell_phone_country_code`, text): The two-letter country code of the mobile number, such as DK or GB.
- Phone (`phone`, text): Another phone number for the employee.
- Street address (`street1`, text): The first line of the employee's address.
- Address line 2 (`street2`, text): The second line of the employee's address.
- Postcode (`zip`, text): The postcode or ZIP code of the employee's address.
- City (`city`, text): The city of the employee's address.
- Employee groups (`employee_group_ids`, list): The employee groups (roles in the schedule) the employee belongs to.
- Employee type (`employee_type_id`, number): The employee type, such as full time or hourly.
- Primary department (`primary_department_id`, number): The employee's main department, on portals where this field is turned on.
- Hired from (`hired_from`, date): The date the employee was hired.
- Birth date (`birth_date`, date): The employee's date of birth.
- Gender (`gender`, text): The employee's gender. One of: `Male`, `Female`.
- Job title (`job_title`, text): The employee's job title.
- Salary identifier (`salary_identifier`, text): The employee's salary code, used by payroll.
- Hours per month (`work_hours`, number): The hours the employee is contracted to work each month. At least 0.
- Visible to colleagues (`is_public`, true/false): Whether other employees can see this employee's details.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```
