> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deputy

> Employees, timesheets, rosters, locations, and leave management.

The Deputy connector lets your workflows manage workforce operations including employee records, timesheets, rosters, locations, and leave requests.

<Note>
  For the full API reference, see the [Deputy API documentation](https://developer.deputy.com/docs/getting-started-with-the-deputy-api).
</Note>

<Snippet file="connection-note.mdx" />

## Connection setup

<Steps>
  <Step title="Get your API credentials">
    Log in to your Deputy account and navigate to the API section to generate a permanent access token. You will also need your full Deputy install URL (e.g., `https://mycompany.na.deputy.com`).
  </Step>

  <Step title="Add the connection in Spojit">
    Go to **Connections** in Spojit, click **Add Connection**, select **Deputy**, and enter:

    * **Install URL**: Your full Deputy URL (e.g., `https://mycompany.na.deputy.com`)
    * **Access Token**: Your permanent API access token
  </Step>
</Steps>

## Tools

### Employees

<AccordionGroup>
  <Accordion title="list-employees: List employees">
    Returns all employees. No parameters required.

    **Example response:**

    ```json theme={null}
    [
      {
        "Id": 101,
        "Company": 1,
        "FirstName": "John",
        "LastName": "Doe",
        "DisplayName": "John Doe",
        "OtherName": null,
        "Salutation": "Mr.",
        "MainAddress": null,
        "PostalAddress": null,
        "Contact": 102512,
        "EmergencyAddress": null,
        "DateOfBirth": "1990-05-15T00:00:00+10:00",
        "Gender": 1,
        "Pronouns": 1,
        "CustomPronouns": null,
        "Photo": 5824,
        "UserId": 101,
        "JobAppId": null,
        "Active": true,
        "StartDate": "2022-05-26T00:00:00+10:00",
        "TerminationDate": null,
        "StressProfile": 1,
        "Position": "Barista",
        "HigherDuty": null,
        "Role": 50,
        "AllowAppraisal": true,
        "HistoryId": 107406,
        "CustomFieldData": null,
        "Creator": 1,
        "Created": "2022-05-26T17:09:22+10:00",
        "Modified": "2025-03-05T11:48:32+10:00"
      },
      {
        "Id": 102,
        "Company": 1,
        "FirstName": "Sarah",
        "LastName": "Miller",
        "DisplayName": "Sarah Miller",
        "Active": true,
        "StartDate": "2023-01-10T00:00:00+10:00",
        "Position": "Shift Supervisor",
        "Role": 50,
        "Creator": 1,
        "Created": "2023-01-10T09:15:00+10:00",
        "Modified": "2025-02-18T14:30:00+10:00"
      }
    ]
    ```
  </Accordion>

  <Accordion title="get-employee: Get an employee by ID">
    <ParamField body="id" type="number" required>
      Employee ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 101
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "Id": 101,
      "Company": 1,
      "FirstName": "John",
      "LastName": "Doe",
      "DisplayName": "John Doe",
      "OtherName": null,
      "Salutation": "Mr.",
      "MainAddress": 3045,
      "PostalAddress": null,
      "Contact": 102512,
      "EmergencyAddress": 3046,
      "DateOfBirth": "1990-05-15T00:00:00+10:00",
      "Gender": 1,
      "Pronouns": 1,
      "CustomPronouns": null,
      "Photo": 5824,
      "UserId": 101,
      "JobAppId": null,
      "Active": true,
      "StartDate": "2022-05-26T00:00:00+10:00",
      "TerminationDate": null,
      "StressProfile": 1,
      "Position": "Barista",
      "HigherDuty": null,
      "Role": 50,
      "AllowAppraisal": true,
      "HistoryId": 107406,
      "CustomFieldData": null,
      "Creator": 1,
      "Created": "2022-05-26T17:09:22+10:00",
      "Modified": "2025-03-05T11:48:32+10:00"
    }
    ```
  </Accordion>

  <Accordion title="create-employee: Create a new employee">
    <ParamField body="employee" type="object" required>
      Employee object with fields: `FirstName`, `LastName`, `Company` (location ID), `DisplayName`, `Position`, etc.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "employee": {
        "FirstName": "Michael",
        "LastName": "Jones",
        "DisplayName": "Michael Jones",
        "Company": 1,
        "Position": "Barista",
        "Active": true,
        "StartDate": "2025-04-01",
        "Role": 50
      }
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "Id": 581,
      "Company": 1,
      "FirstName": "Michael",
      "LastName": "Jones",
      "DisplayName": "Michael Jones",
      "OtherName": null,
      "Salutation": null,
      "MainAddress": null,
      "PostalAddress": null,
      "Contact": null,
      "EmergencyAddress": null,
      "DateOfBirth": null,
      "Gender": null,
      "Pronouns": 0,
      "CustomPronouns": null,
      "Photo": null,
      "UserId": 581,
      "JobAppId": null,
      "Active": true,
      "StartDate": "2025-04-01T00:00:00+10:00",
      "TerminationDate": null,
      "StressProfile": 1,
      "Position": "Barista",
      "HigherDuty": null,
      "Role": 50,
      "AllowAppraisal": true,
      "HistoryId": 115659,
      "CustomFieldData": null,
      "Creator": 1,
      "Created": "2025-04-01T09:00:00+10:00",
      "Modified": "2025-04-01T09:00:00+10:00"
    }
    ```
  </Accordion>
</AccordionGroup>

### Timesheets

<AccordionGroup>
  <Accordion title="list-timesheets: List timesheets">
    Returns all timesheets. No parameters required.

    **Example response:**

    ```json theme={null}
    [
      {
        "Id": 1,
        "Employee": 101,
        "EmployeeHistory": 2586,
        "EmployeeAgreement": 5,
        "Date": "2025-03-28T00:00:00+10:00",
        "StartTime": 1743116400,
        "EndTime": 1743145200,
        "Mealbreak": "2025-03-28T00:30:00+10:00",
        "MealbreakSlots": {
          "1743138600": "OUT",
          "1743140400": "IN"
        },
        "TotalTime": 7.5,
        "TotalTimeInv": 7.5,
        "Cost": 187.5,
        "Roster": 714,
        "OperationalUnit": 1,
        "IsInProgress": false,
        "IsLeave": false,
        "LeaveId": null,
        "LeaveRule": null,
        "Invoiced": false,
        "InvoiceComment": null,
        "PayRuleApproved": true,
        "Exported": false,
        "StagingId": null,
        "PayStaged": false,
        "AutoProcessed": true,
        "AutoRounded": false,
        "AutoTimeApproved": false,
        "AutoPayRuleApproved": false,
        "Creator": 101,
        "Created": "2025-03-28T09:00:00+10:00",
        "Modified": "2025-03-28T17:00:00+10:00",
        "OnCost": 187.5,
        "StartTimeLocalized": "2025-03-28T09:00:00+10:00",
        "EndTimeLocalized": "2025-03-28T17:00:00+10:00"
      }
    ]
    ```
  </Accordion>

  <Accordion title="get-timesheet: Get a timesheet by ID">
    <ParamField body="id" type="number" required>
      Timesheet ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 1
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "Id": 1,
      "Employee": 101,
      "EmployeeHistory": 2586,
      "EmployeeAgreement": 5,
      "Date": "2025-03-28T00:00:00+10:00",
      "StartTime": 1743116400,
      "EndTime": 1743145200,
      "Mealbreak": "2025-03-28T00:30:00+10:00",
      "MealbreakSlots": {
        "1743138600": "OUT",
        "1743140400": "IN"
      },
      "TotalTime": 7.5,
      "TotalTimeInv": 7.5,
      "Cost": 187.5,
      "Roster": 714,
      "OperationalUnit": 1,
      "IsInProgress": false,
      "IsLeave": false,
      "LeaveId": null,
      "LeaveRule": null,
      "Invoiced": false,
      "InvoiceComment": null,
      "PayRuleApproved": true,
      "Exported": false,
      "StagingId": null,
      "PayStaged": false,
      "AutoProcessed": true,
      "AutoRounded": false,
      "AutoTimeApproved": false,
      "AutoPayRuleApproved": false,
      "Creator": 101,
      "Created": "2025-03-28T09:00:00+10:00",
      "Modified": "2025-03-28T17:00:00+10:00",
      "OnCost": 187.5,
      "StartTimeLocalized": "2025-03-28T09:00:00+10:00",
      "EndTimeLocalized": "2025-03-28T17:00:00+10:00"
    }
    ```
  </Accordion>
</AccordionGroup>

### Scheduling

<AccordionGroup>
  <Accordion title="list-rosters: List roster schedules">
    Returns all roster shifts. No parameters required.

    **Example response:**

    ```json theme={null}
    [
      {
        "Id": 714,
        "Date": "2025-04-01T00:00:00+10:00",
        "StartTime": 1743454800,
        "EndTime": 1743496200,
        "Mealbreak": "2025-04-01T00:30:00+10:00",
        "Slots": [
          {
            "blnEmptySlot": false,
            "strType": "B",
            "intStart": 900,
            "intEnd": 2700,
            "intUnixStart": 1743455700,
            "intUnixEnd": 1743457500,
            "mixedActivity": {
              "intState": 3,
              "blnCanStartEarly": 1,
              "blnCanEndEarly": 1,
              "blnIsMandatory": 1,
              "strBreakType": "M"
            },
            "strTypeName": "Meal Break",
            "strState": "Scheduled Duration"
          }
        ],
        "TotalTime": 11,
        "Cost": 275.0,
        "OperationalUnit": 1,
        "Employee": 101,
        "Comment": "",
        "Warning": "",
        "WarningOverrideComment": "",
        "Published": true,
        "Open": false,
        "ConfirmStatus": 2,
        "ConfirmComment": null,
        "SwapStatus": 0,
        "ConnectStatus": 0,
        "MatchedByTimesheet": 1,
        "CustomFieldData": null,
        "Creator": 1,
        "Created": "2025-03-25T14:01:44+10:00",
        "Modified": "2025-04-01T09:09:41+10:00"
      }
    ]
    ```
  </Accordion>
</AccordionGroup>

### Locations

<AccordionGroup>
  <Accordion title="list-locations: List locations">
    Returns all company locations. No parameters required.

    **Example response:**

    ```json theme={null}
    [
      {
        "Id": 1,
        "Code": "LOC001",
        "Active": true,
        "ParentCompany": 0,
        "CompanyName": "Downtown Cafe",
        "CompanyNumber": "",
        "TradingName": "Downtown Cafe",
        "IsWorkplace": true,
        "IsPayrollEntity": true,
        "PayrollExportCode": "DC001",
        "Address": 1001,
        "Contact": 2001,
        "Creator": 1,
        "Created": "2022-01-15T10:00:00+10:00",
        "Modified": "2025-02-20T14:30:00+10:00"
      },
      {
        "Id": 2,
        "Code": "LOC002",
        "Active": true,
        "ParentCompany": 0,
        "CompanyName": "Airport Kiosk",
        "CompanyNumber": "",
        "TradingName": "Airport Kiosk",
        "IsWorkplace": true,
        "IsPayrollEntity": true,
        "PayrollExportCode": "AK002",
        "Address": 1002,
        "Contact": 2002,
        "Creator": 1,
        "Created": "2022-03-01T09:00:00+10:00",
        "Modified": "2025-01-10T11:15:00+10:00"
      }
    ]
    ```
  </Accordion>
</AccordionGroup>

### Leave

<AccordionGroup>
  <Accordion title="list-leave: List leave requests">
    Returns all leave requests. No parameters required.

    **Example response:**

    ```json theme={null}
    [
      {
        "Id": 2,
        "Employee": 101,
        "EmployeeHistory": 12176,
        "Company": 1,
        "LeaveRule": 1,
        "Start": 1736816400,
        "DateStart": "2025-01-14T00:00:00+11:00",
        "End": 1736927100,
        "DateEnd": "2025-01-15T23:59:59+11:00",
        "Days": null,
        "ApproverTime": null,
        "ApproverPay": null,
        "Comment": "Annual Leave",
        "Status": 1,
        "ApprovalComment": "Approved by manager",
        "TotalHours": 16,
        "ExternalId": null,
        "AllDay": false,
        "Creator": 1,
        "Created": "2025-01-06T10:32:28+10:00",
        "Modified": "2025-01-07T09:15:00+10:00",
        "StartTimeLocalized": "2025-01-14T09:00:00+11:00",
        "EndTimeLocalized": "2025-01-15T17:00:00+11:00",
        "TimeZone": "Australia/Sydney"
      }
    ]
    ```
  </Accordion>

  <Accordion title="create-leave: Create a leave request">
    <ParamField body="leave" type="object" required>
      Leave object with fields: `Employee`, `LeaveRule`, `Company`, `DateStart`, `DateEnd`, `Comment`, `Status`, etc.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "leave": {
        "Employee": 101,
        "LeaveRule": 1,
        "Company": 1,
        "DateStart": "2025-04-14",
        "Start": 1744578000,
        "DateEnd": "2025-04-15",
        "End": 1744688700,
        "Comment": "Annual Leave"
      }
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "Id": 15,
      "Employee": 101,
      "EmployeeHistory": 12176,
      "Company": 1,
      "LeaveRule": 1,
      "Start": 1744578000,
      "DateStart": "2025-04-14T00:00:00+10:00",
      "End": 1744688700,
      "DateEnd": "2025-04-15T23:59:59+10:00",
      "Days": null,
      "ApproverTime": null,
      "ApproverPay": null,
      "Comment": "Annual Leave",
      "Status": 0,
      "ApprovalComment": null,
      "TotalHours": null,
      "ExternalId": null,
      "AllDay": false,
      "Creator": 1,
      "Created": "2025-04-01T10:00:00+10:00",
      "Modified": "2025-04-01T10:00:00+10:00",
      "StartTimeLocalized": "2025-04-14T09:00:00+10:00",
      "EndTimeLocalized": "2025-04-15T17:45:00+10:00",
      "TimeZone": "Australia/Sydney",
      "DateStartAllDay": false,
      "DateEndAllDay": false,
      "NotifyManagerArray": [],
      "LeavePayLineArray": []
    }
    ```
  </Accordion>
</AccordionGroup>

### Advanced

<AccordionGroup>
  <Accordion title="raw-api-request: Make an arbitrary API request">
    Send a request to any Deputy API endpoint.

    <ParamField body="method" type="string" required>
      HTTP method: `GET`, `POST`, `PUT`, or `DELETE`.
    </ParamField>

    <ParamField body="path" type="string" required>
      API path (e.g., `/resource/OperationalUnit` or `/resource/Task`).
    </ParamField>

    <ParamField body="body" type="object">
      Request body for `POST` and `PUT` requests.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "method": "POST",
      "path": "/resource/Timesheet/QUERY",
      "body": {
        "search": {
          "s1": {
            "field": "Employee",
            "data": 101,
            "type": "eq"
          }
        }
      }
    }
    ```

    **Example response:**

    ```json theme={null}
    [
      {
        "Id": 1,
        "Employee": 101,
        "Date": "2025-03-28T00:00:00+10:00",
        "StartTime": 1743116400,
        "EndTime": 1743145200,
        "TotalTime": 7.5,
        "Cost": 187.5,
        "IsInProgress": false,
        "IsLeave": false,
        "PayRuleApproved": true,
        "StartTimeLocalized": "2025-03-28T09:00:00+10:00",
        "EndTimeLocalized": "2025-03-28T17:00:00+10:00"
      }
    ]
    ```
  </Accordion>
</AccordionGroup>
