Skip to content

Latest commit

 

History

History
executable file
·
549 lines (398 loc) · 36.5 KB

File metadata and controls

executable file
·
549 lines (398 loc) · 36.5 KB

employees

Available Operations

deleteV1Employee

Use this endpoint to delete an employee who is in onboarding. Deleting an onboarded employee is not allowed. Please check out the Terminations api if you need to terminate an onboarded employee.

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { DeleteV1EmployeeRequest, DeleteV1EmployeeResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "deleniti";

sdk.employees.deleteV1Employee(employeeId).then((res: DeleteV1EmployeeResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeleteV1EmployeeResponse>

getV1Employees

Get an employee.

scope: employees:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { GetV1EmployeesInclude, GetV1EmployeesRequest, GetV1EmployeesResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "itaque";
const include: GetV1EmployeesInclude = GetV1EmployeesInclude.CustomFields;

sdk.employees.getV1Employees(employeeId, include).then((res: GetV1EmployeesResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
include operations.GetV1EmployeesInclude Include the requested attribute(s) in each employee response, multiple options are comma separated. Available options:
- all_compensations: Include all effective dated compensations for each job instead of only the current compensation
- custom_fields: Include employees' custom fields
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1EmployeesResponse>

getV1EmployeesEmployeeIdCustomFields

Returns a list of the employee's custom fields.

scope: employees:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1EmployeesEmployeeIdCustomFieldsRequest,
  GetV1EmployeesEmployeeIdCustomFieldsResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "architecto";
const page: number = 6091.78;
const per: number = 9453.02;

sdk.employees.getV1EmployeesEmployeeIdCustomFields(employeeId, page, per).then((res: GetV1EmployeesEmployeeIdCustomFieldsResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
page number The page that is requested. When unspecified, will load all objects.
per number Number of objects per page. When unspecified, will default to 25
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1EmployeesEmployeeIdCustomFieldsResponse>

getV1EmployeesEmployeeIdHomeAddress

The home address of an employee is used to determine certain tax information about them. Addresses are geocoded on create and update to ensure validity.

scope: employees:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1EmployeesEmployeeIdHomeAddressRequest,
  GetV1EmployeesEmployeeIdHomeAddressResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "quasi";

sdk.employees.getV1EmployeesEmployeeIdHomeAddress(employeeId).then((res: GetV1EmployeesEmployeeIdHomeAddressResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1EmployeesEmployeeIdHomeAddressResponse>

getV1EmployeesEmployeeIdOnboardingStatus

Description

Retrieves an employee's onboarding status. The data returned helps inform the required onboarding steps and respective completion status.

scope: employees:read

onboarding_status

Admin-facilitated onboarding

onboarding_status Description
admin_onboarding_incomplete Admin needs to complete the full employee-onboarding.
onboarding_completed Employee has been fully onboarded and verified.

Employee self-onboarding

onboarding_status Description
admin_onboarding_incomplete Admin needs to enter basic information about the employee.
self_onboarding_pending_invite Admin has the intention to invite the employee to self-onboard (e.g., marking a checkbox), but the system has not yet sent the invitation.
self_onboarding_invited Employee has been sent an invitation to self-onboard.
self_onboarding_invited_started Employee has started the self-onboarding process.
self_onboarding_invited_overdue Employee's start date has passed, and employee has still not completed self-onboarding.
self_onboarding_completed_by_employee Employee has completed entering in their information. The status should be updated via API to "self_onboarding_awaiting_admin_review" from here, once the Admin has started reviewing.
self_onboarding_awaiting_admin_review Admin needs to review employee's entered information and confirm onboarding.
onboarding_completed Employee has been fully onboarded and verified.

onboarding_steps

onboarding_steps Requirement(s) to be completed
personal_details Add employee's first name, last name, email, date of birth, social security number
compensation_details Associate employee to a job & compensation.
add_work_address Add employee work address.
add_home_address Add employee home address.
federal_tax_setup Set up federal tax withholdings.
state_tax_setup Set up state tax withholdings.
direct_deposit_setup Set up employee's direct deposit.
employee_form_signing Employee forms (e.g., W4, direct deposit authorization) are generated & signed.
admin_review Admin reviews & confirms employee details (only required for Employee self-onboarding)

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1EmployeesEmployeeIdOnboardingStatusRequest,
  GetV1EmployeesEmployeeIdOnboardingStatusResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "at";

sdk.employees.getV1EmployeesEmployeeIdOnboardingStatus(employeeId).then((res: GetV1EmployeesEmployeeIdOnboardingStatusResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1EmployeesEmployeeIdOnboardingStatusResponse>

getVersionEmployeesTimeOffActivities

Get employee time off activities.

scope: employee_time_off_activities:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetVersionEmployeesTimeOffActivitiesRequest,
  GetVersionEmployeesTimeOffActivitiesResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeUuid: string = "et";
const timeOffType: string = "voluptate";

sdk.employees.getVersionEmployeesTimeOffActivities(employeeUuid, timeOffType).then((res: GetVersionEmployeesTimeOffActivitiesResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeUuid string ✔️ The UUID of the employee
timeOffType string The time off type name you want to query data for. ex: 'sick' or 'vacation'
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetVersionEmployeesTimeOffActivitiesResponse>

postV1Employees

Create an employee.

scope: employees:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { PostV1EmployeesRequest, PostV1EmployeesRequestBody, PostV1EmployeesResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyId: string = "ipsa";
const requestBody: PostV1EmployeesRequestBody = {
  dateOfBirth: "minima",
  email: "Darlene_Ferry@gmail.com",
  firstName: "Alexanne",
  lastName: "Ledner",
  middleInitial: "aut",
  selfOnboarding: false,
  ssn: "laudantium",
};

sdk.employees.postV1Employees(companyId, requestBody).then((res: PostV1EmployeesResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyId string ✔️ The UUID of the company
requestBody operations.PostV1EmployeesRequestBody Create an employee.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PostV1EmployeesResponse>

putV1EmployeeFinishOnboarding

This endpoint is currently supported but will eventually be deprecated; please use /v1/employees/{employee_id}/onboarding_status instead.

Call this endpoint as the very last step of employee onboarding to complete their onboarding. When successful, the employee's onboarded attribute will be updated to true, indicating that they can be included in company's payrolls.

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { PutV1EmployeeFinishOnboardingRequest, PutV1EmployeeFinishOnboardingResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "eum";

sdk.employees.putV1EmployeeFinishOnboarding(employeeId).then((res: PutV1EmployeeFinishOnboardingResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PutV1EmployeeFinishOnboardingResponse>

putV1Employees

Update an employee.

scope: employees:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { PutV1EmployeesRequest, PutV1EmployeesRequestBody, PutV1EmployeesResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "mollitia";
const requestBody: PutV1EmployeesRequestBody = {
  dateOfBirth: "ab",
  email: "Demond58@yahoo.com",
  firstName: "Dennis",
  lastName: "Russel",
  middleInitial: "explicabo",
  ssn: "voluptas",
  twoPercentShareholder: false,
  version: "aut",
};

sdk.employees.putV1Employees(employeeId, requestBody).then((res: PutV1EmployeesResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
requestBody operations.PutV1EmployeesRequestBody Update an employee.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PutV1EmployeesResponse>

putV1EmployeesEmployeeIdHomeAddress

The home address of an employee is used to determine certain tax information about them. Addresses are geocoded on create and update to ensure validity.

scope: employees:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  PutV1EmployeesEmployeeIdHomeAddressRequest,
  PutV1EmployeesEmployeeIdHomeAddressRequestBody,
  PutV1EmployeesEmployeeIdHomeAddressResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "dignissimos";
const requestBody: PutV1EmployeesEmployeeIdHomeAddressRequestBody = {
  city: "Fort Libbieburgh",
  state: "voluptatibus",
  street1: "voluptas",
  street2: "asperiores",
  version: "aperiam",
  zip: "ea",
};

sdk.employees.putV1EmployeesEmployeeIdHomeAddress(employeeId, requestBody).then((res: PutV1EmployeesEmployeeIdHomeAddressResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
requestBody operations.PutV1EmployeesEmployeeIdHomeAddressRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PutV1EmployeesEmployeeIdHomeAddressResponse>

putV1EmployeesEmployeeIdOnboardingStatus

scope: employees:write

Updates an employee's onboarding status. Below is a list of valid onboarding status changes depending on the intended action to be performed on behalf of the employee.

Action current onboarding_status new onboarding_status
Mark an employee as self-onboarding admin_onboarding_incomplete self_onboarding_pending_invite
Invite an employee to self-onboard admin_onboarding_incomplete or self_onboarding_pending_invite self_onboarding_invited
Cancel an employee's self-onboarding self_onboarding_invited or self_onboarding_pending_invite admin_onboarding_incomplete
Review an employee's self-onboarded info self_onboarding_completed_by_employee self_onboarding_awaiting_admin_review
Finish an employee's onboarding admin_onboarding_incomplete or self_onboarding_awaiting_admin_review onboarding_completed

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  PutV1EmployeesEmployeeIdOnboardingStatusRequest,
  PutV1EmployeesEmployeeIdOnboardingStatusRequestBody,
  PutV1EmployeesEmployeeIdOnboardingStatusResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const employeeId: string = "quaerat";
const requestBody: PutV1EmployeesEmployeeIdOnboardingStatusRequestBody = {
  onboardingStatus: "consequuntur",
};

sdk.employees.putV1EmployeesEmployeeIdOnboardingStatus(employeeId, requestBody).then((res: PutV1EmployeesEmployeeIdOnboardingStatusResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
employeeId string ✔️ The UUID of the employee
requestBody operations.PutV1EmployeesEmployeeIdOnboardingStatusRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PutV1EmployeesEmployeeIdOnboardingStatusResponse>