# Insightful

> Work with employees, teams, projects, tasks, shifts and time off in Insightful.

App · 27 actions. Web page: https://docs.lodol.com/docs/integrations/insightful

## Actions

### Add time off

Queue time off for an employee. It replaces any time off it overlaps. Needs Insightful's Time Off feature.

**Inputs**

- Employee (`employee_id`, text, required): The employee taking time off.
- Start (`start`, date and time, required): When the time off starts.
- End (`end`, date and time, required): When the time off ends.
- Time zone (`timezone`, text, required): The employee's time zone, such as `America/New_York`.
- Length (`duration_type`, text, required): A whole day or days, or part of a day. One of: `full`, `partial`.
- Type (`type`, text, required): The time off type's name in Insightful, such as `vacation`.
- External ID (`external_id`, text): Your own reference, to find the entry later with List time off.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "jobId": 1,
    "message": "example",
    "received": 1,
    "url": "example"
  }
}
```

### Check added time off

See whether queued time off was created, and why not if it wasn't.

**Inputs**

- Job ID (`job_id`, text, required): The job ID Add time off returned.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "result": {
      "created": [
        {
          "employeeId": "example",
          "end": 1,
          "reason": "example",
          "start": 1
        }
      ],
      "deleted": [
        {
          "employeeId": "example",
          "end": 1,
          "reason": "example",
          "start": 1
        }
      ],
      "errors": [
        {
          "employeeId": "example",
          "end": 1,
          "reason": "example",
          "start": 1
        }
      ],
      "received": 1
    },
    "status": "example"
  }
}
```

### Create a project

Add a project employees can track time to.

**Inputs**

- Name (`name`, text, required): The project's name.
- Employees (`employee_ids`, list, required): The employees who work on the project.
- Description (`description`, text): What the project is.
- Billable (`billable`, true/false): Whether time on the project is billable.
- Deadline (`deadline`, date and time): When the project is due.
- Task statuses (`statuses`, list): The statuses its tasks can have, such as `To do`, `In progress`, `Done`.
- Task priorities (`priorities`, list): The priorities its tasks can have, such as `low`, `medium`, `high`.
- Bill rate (`bill_rate`, number): The hourly bill rate.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "name": "example",
    "organizationId": "example",
    "payroll": {
      "billRate": 1,
      "overtimeBillrate": 1
    },
    "priorities": [
      "example"
    ],
    "statuses": [
      "example"
    ],
    "teams": [
      "example"
    ]
  }
}
```

### Create a task

Add a task to a project.

**Inputs**

- Project (`project_id`, text, required): The project the task belongs to.
- Name (`name`, text, required): The task's name.
- Employees (`employee_ids`, list, required): The employees assigned to the task.
- Description (`description`, text): What the task is.
- Status (`status`, text): The task's status, one of its project's statuses.
- Priority (`priority`, text): The task's priority, one of its project's priorities.
- Billable (`billable`, true/false): Whether time on the task is billable.
- Deadline (`deadline`, date and time): When the task is due.
- Labels (`labels`, list): Labels for the task.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "labels": [
      "example"
    ],
    "name": "example",
    "organizationId": "example",
    "priority": "example",
    "projectId": "example",
    "status": "example",
    "teams": [
      "example"
    ]
  }
}
```

### Create a team

Add a team to your organization.

**Inputs**

- Name (`name`, text, required): The team's name.
- Description (`description`, text): What the team is.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "createdAt": 1,
    "default": true,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "ignoreNeutral": true,
    "ignoreProductive": true,
    "ignoreUnproductive": true,
    "ignoreUnreviewed": true,
    "name": "example",
    "organizationId": "example",
    "projects": [
      "example"
    ]
  }
}
```

### Deactivate an employee

Stop tracking an employee and free their seat.

**Inputs**

- Employee (`employee_id`, text, required): The employee.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accountId": "example",
    "createdAt": 1,
    "deactivated": 1,
    "email": "example",
    "id": "example",
    "identifier": "example",
    "invited": 1,
    "name": "example",
    "organizationId": "example",
    "projects": [
      "example"
    ],
    "sharedSettingsId": "example",
    "teamId": "example",
    "type": "example"
  }
}
```

### Delete a project

Delete a project.

**Inputs**

- Project (`project_id`, text, required): The project.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "name": "example",
    "organizationId": "example",
    "payroll": {
      "billRate": 1,
      "overtimeBillrate": 1
    },
    "priorities": [
      "example"
    ],
    "statuses": [
      "example"
    ],
    "teams": [
      "example"
    ]
  }
}
```

### Delete a task

Delete a task.

**Inputs**

- Task ID (`task_id`, text, required): The task's ID.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "labels": [
      "example"
    ],
    "name": "example",
    "organizationId": "example",
    "priority": "example",
    "projectId": "example",
    "status": "example",
    "teams": [
      "example"
    ]
  }
}
```

### Delete a team

Delete a team. The default team can't be deleted.

**Inputs**

- Team (`insightful_team_id`, text, required): The team.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "createdAt": 1,
    "default": true,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "ignoreNeutral": true,
    "ignoreProductive": true,
    "ignoreUnproductive": true,
    "ignoreUnreviewed": true,
    "name": "example",
    "organizationId": "example",
    "projects": [
      "example"
    ]
  }
}
```

### Get a project

Get one project with its employees and task settings.

**Inputs**

- Project (`project_id`, text, required): The project.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "name": "example",
    "organizationId": "example",
    "payroll": {
      "billRate": 1,
      "overtimeBillrate": 1
    },
    "priorities": [
      "example"
    ],
    "statuses": [
      "example"
    ],
    "teams": [
      "example"
    ]
  }
}
```

### Get a task

Get one task.

**Inputs**

- Task ID (`task_id`, text, required): The task's ID.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "labels": [
      "example"
    ],
    "name": "example",
    "organizationId": "example",
    "priority": "example",
    "projectId": "example",
    "status": "example",
    "teams": [
      "example"
    ]
  }
}
```

### Get a team

Get one team with its employees and projects.

**Inputs**

- Team (`insightful_team_id`, text, required): The team.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "createdAt": 1,
    "default": true,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "ignoreNeutral": true,
    "ignoreProductive": true,
    "ignoreUnproductive": true,
    "ignoreUnreviewed": true,
    "name": "example",
    "organizationId": "example",
    "projects": [
      "example"
    ]
  }
}
```

### Get an employee

Get one employee's details.

**Inputs**

- Employee (`employee_id`, text, required): The employee.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accountId": "example",
    "createdAt": 1,
    "deactivated": 1,
    "email": "example",
    "id": "example",
    "identifier": "example",
    "invited": 1,
    "name": "example",
    "organizationId": "example",
    "projects": [
      "example"
    ],
    "sharedSettingsId": "example",
    "teamId": "example",
    "type": "example"
  }
}
```

### Get daily timesheets

Each employee's timesheet, day by day, for a period.

**Inputs**

- From (`start`, date and time, required): The start of the period.
- To (`end`, date and time, required): The end of the period.
- Time zone (`timezone`, text): The time zone to count days in, such as `America/New_York`.
- Employees (`employee_ids`, list): Only these employees.
- Teams (`team_ids`, list): Only these teams.

**Outputs**

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

**Example output**

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

### Get time per project

Total tracked time (in milliseconds), cost and income per project for a period.

**Inputs**

- From (`start`, date and time, required): The start of the period.
- To (`end`, date and time, required): The end of the period.
- Time zone (`timezone`, text): The time zone to count days in, such as `America/New_York`.
- Employees (`employee_ids`, list): Only these employees.
- Teams (`team_ids`, list): Only these teams.
- Projects (`project_ids`, list): Only these projects.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "costs": 1,
      "id": "example",
      "income": 1,
      "time": 1
    }
  ]
}
```

### Invite an employee

Add an employee and send them Insightful's invitation.

**Inputs**

- Name (`name`, text, required): The employee's name.
- Email (`email`, text, required): The employee's email address.
- Team (`insightful_team_id`, text, required): The team they join.
- Settings (`shared_settings_id`, text, required): The tracking settings that apply to them.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accountId": "example",
    "createdAt": 1,
    "deactivated": 1,
    "email": "example",
    "id": "example",
    "identifier": "example",
    "invited": 1,
    "name": "example",
    "organizationId": "example",
    "projects": [
      "example"
    ],
    "sharedSettingsId": "example",
    "teamId": "example",
    "type": "example"
  }
}
```

### List employees

List every employee in your organization.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "accountId": "example",
      "createdAt": 1,
      "deactivated": 1,
      "email": "example",
      "id": "example",
      "identifier": "example",
      "invited": 1,
      "name": "example",
      "organizationId": "example",
      "projects": [
        "example"
      ],
      "sharedSettingsId": "example",
      "teamId": "example",
      "type": "example"
    }
  ]
}
```

### List managers

List the managers in your organization.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "email": "example",
      "id": "example",
      "name": "example",
      "organizationId": "example"
    }
  ]
}
```

### List projects

List the projects in your organization.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "billable": true,
      "createdAt": 1,
      "creatorId": "example",
      "deadline": 1,
      "description": "example",
      "employees": [
        "example"
      ],
      "id": "example",
      "name": "example",
      "organizationId": "example",
      "payroll": {
        "billRate": 1,
        "overtimeBillrate": 1
      },
      "priorities": [
        "example"
      ],
      "statuses": [
        "example"
      ],
      "teams": [
        "example"
      ]
    }
  ]
}
```

### List shifts

List the work shifts employees tracked in a period.

**Inputs**

- From (`start`, date and time, required): The start of the period.
- To (`end`, date and time, required): The end of the period.
- Time zone (`timezone`, text): The time zone to count days in, such as `America/New_York`.
- Employees (`employee_ids`, list): Only these employees.
- Teams (`team_ids`, list): Only these teams.
- Projects (`project_ids`, list): Only these projects.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "computer": "example",
      "createdAt": "example",
      "employeeId": "example",
      "end": 1,
      "id": "example",
      "name": "example",
      "organizationId": "example",
      "os": "example",
      "paid": true,
      "payRate": 1,
      "start": 1,
      "teamId": "example",
      "timezoneOffset": 1,
      "type": "example",
      "updatedAt": "example",
      "user": "example"
    }
  ]
}
```

### List tasks

List the tasks in your organization.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "billable": true,
      "createdAt": 1,
      "creatorId": "example",
      "deadline": 1,
      "description": "example",
      "employees": [
        "example"
      ],
      "id": "example",
      "labels": [
        "example"
      ],
      "name": "example",
      "organizationId": "example",
      "priority": "example",
      "projectId": "example",
      "status": "example",
      "teams": [
        "example"
      ]
    }
  ]
}
```

### List teams

List the teams in your organization.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "createdAt": 1,
      "default": true,
      "description": "example",
      "employees": [
        "example"
      ],
      "id": "example",
      "ignoreNeutral": true,
      "ignoreProductive": true,
      "ignoreUnproductive": true,
      "ignoreUnreviewed": true,
      "name": "example",
      "organizationId": "example",
      "projects": [
        "example"
      ]
    }
  ]
}
```

### List time off

List time off that overlaps a period.

**Inputs**

- From (`start`, date and time, required): The start of the period.
- To (`end`, date and time, required): The end of the period.
- Employees (`employee_ids`, list): Only these employees.
- Teams (`team_ids`, list): Only these teams.
- External ID (`external_id`, text): Only the entry with your own reference.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [
      {
        "category": "example",
        "createdAt": 1,
        "creatorType": "example",
        "duration": 1,
        "durationType": "example",
        "employeeId": "example",
        "end": 1,
        "externalId": "example",
        "id": "example",
        "note": "example",
        "start": 1,
        "teamId": "example",
        "timezone": "example",
        "type": "example",
        "typeId": "example",
        "updatedAt": 1
      }
    ]
  }
}
```

### List tracking settings

List the shared tracking settings employees can be given.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Insightful.

**Example output**

```json
{
  "data": [
    {
      "description": "example",
      "id": "example",
      "name": "example",
      "organizationId": "example",
      "settings": {
        "days": {},
        "privileges": {},
        "type": "example"
      },
      "type": "example"
    }
  ]
}
```

### Update a project

Change a project. Fields left empty keep their current value; lists replace the current ones.

**Inputs**

- Project (`project_id`, text, required): The project.
- Name (`name`, text): The project's name.
- Employees (`employee_ids`, list): The employees who work on the project.
- Description (`description`, text): What the project is.
- Billable (`billable`, true/false): Whether time on the project is billable.
- Deadline (`deadline`, date and time): When the project is due.
- Task statuses (`statuses`, list): The statuses its tasks can have, such as `To do`, `In progress`, `Done`.
- Task priorities (`priorities`, list): The priorities its tasks can have, such as `low`, `medium`, `high`.
- Bill rate (`bill_rate`, number): The hourly bill rate.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "name": "example",
    "organizationId": "example",
    "payroll": {
      "billRate": 1,
      "overtimeBillrate": 1
    },
    "priorities": [
      "example"
    ],
    "statuses": [
      "example"
    ],
    "teams": [
      "example"
    ]
  }
}
```

### Update a task

Change a task. Fields left empty keep their current value; lists replace the current ones.

**Inputs**

- Task ID (`task_id`, text, required): The task's ID.
- Name (`name`, text): The task's name.
- Employees (`employee_ids`, list): The employees assigned to the task.
- Description (`description`, text): What the task is.
- Status (`status`, text): The task's status, one of its project's statuses.
- Priority (`priority`, text): The task's priority, one of its project's priorities.
- Billable (`billable`, true/false): Whether time on the task is billable.
- Deadline (`deadline`, date and time): When the task is due.
- Labels (`labels`, list): Labels for the task.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billable": true,
    "createdAt": 1,
    "creatorId": "example",
    "deadline": 1,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "labels": [
      "example"
    ],
    "name": "example",
    "organizationId": "example",
    "priority": "example",
    "projectId": "example",
    "status": "example",
    "teams": [
      "example"
    ]
  }
}
```

### Update a team

Change a team's members, projects or what it tracks. Lists replace the current ones.

**Inputs**

- Team (`insightful_team_id`, text, required): The team.
- Description (`description`, text): What the team is.
- Employees (`employee_ids`, list): The team's employees.
- Projects (`project_ids`, list): The team's projects.
- Ignore productive apps (`ignore_productive`, true/false): Stop tracking productive apps for the team.
- Ignore neutral apps (`ignore_neutral`, true/false): Stop tracking neutral apps for the team.
- Ignore unproductive apps (`ignore_unproductive`, true/false): Stop tracking unproductive apps for the team.
- Ignore unreviewed apps (`ignore_unreviewed`, true/false): Stop tracking apps nobody has rated yet.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "createdAt": 1,
    "default": true,
    "description": "example",
    "employees": [
      "example"
    ],
    "id": "example",
    "ignoreNeutral": true,
    "ignoreProductive": true,
    "ignoreUnproductive": true,
    "ignoreUnreviewed": true,
    "name": "example",
    "organizationId": "example",
    "projects": [
      "example"
    ]
  }
}
```
