Adding an Employee

Adding an employee in Deputy is a quite common use case for the API. You can easily sync new employees from own system into Deputy, ready to have shifts and timesheets associated with them. For the addition of new employees to Deputy, we recommend that you use the management endpoints, known as supervise. The process is detailed below

URL and Payload

URL

curl --location --request POST 'https://{install}.{geo}.deputy.com/api/management/v2/employees'

Sample

{
	"data": {
		"firstName": "Michael",
		"lastName": "Jones",
		"displayName": "Michael Jones",
		"otherName": "James",
		"salutation": "Mr.",
		"position": "Employee",
		"primaryLocation": {
			"id": "1"
		},
		"contact": {
			"email1": "[email protected]",
			"phone1": "123345",
			"phone2": "1233045",
			"email2": "[email protected]",
			"notes": "notes here",
			"web": "https://www.deputy.com",
			"fax": "23245435"
		},
		"mainAddress": {
			"contactName": "maine",
			"unitNo": "123",
			"streetNo": "2345",
			"suiteNo": "Suite",
			"poBox": "23456",
			"street": "Street ",
			"street2": "Sesame",
			"suburb": "Sydney",
			"country": "13",
			"state": {
				"id": "21"
			},
			"postcode": "2000",
			"phone": "45466",
			"notes": "note here",
			"format": 1
		},
		"emergencyAddress": {
			"contactName": "Sandra Jones",
			"format": 1,
			"phone": "45466"
		},
		"postalAddress": {
			"unitNo": "123",
			"contactName": "Postal",
			"streetNo": "2345",
			"suiteNo": "Suite",
			"poBox": "23456",
			"street": "Streeet ",
			"street2": "Sesame",
			"suburb": "Sydney",
			"country": "13",
			"state": {
                "id": "13"
            },
			"postcode": "2000",
			"phone": "45466",
			"notes": "note here",
			"format": 1
		},
		"gender": {
			"genderId": "MALE"
		},
		"pronouns": {
			"pronounsId": "HE_HIM"
		},
		"customPronouns": "Custom/Pronouns",
		"higherDuty": true,
		"dateOfBirth": "2001-04-01",
		"startDate": "2019-05-21T14:00:00Z",
		"workplaces": [{
				"location": {
					"id": "1"
				},
				"agreement": {
					"payrollId": "883456999",
					"contract": {
						"id": "1"
					}
				}
			},
			{
				"location": {
					"id": "2"
				}
			}
		],
		"stressProfile": {
			"id": 1
		},
		"externalId": "70abb134-0601-4297-9e8f-73f2960357b3"
	}
}

Response

{
    "success": true,
    "result": {
        "data": {
            "id": "581",
            "primaryLocation": {
                "id": "1"
            },
            "firstName": "Michael",
            "lastName": "Jones",
            "displayName": "Michael Jones",
            "otherName": "James",
            "salutation": "Mr.",
            "pronouns": {
                "pronounsId": "NOT_SPECIFIED",
                "pronouns": "Not specified"
            },
            "contact": {
                "id": "106574",
                "phone1": "123345",
                "phone2": "1233045",
                "fax": "23245435",
                "phone1Type": "Mobile",
                "phone2Type": "Personal",
                "email1": "[email protected]",
                "email1Type": "Work",
                "email2Type": "Personal",
                "email2": "[email protected]",
                "web": "https://www.deputy.com",
                "notes": "notes here"
            },
            "user": {
                "login": "m2jones",
                "sendInvite": false
            },
            "active": true,
            "startDate": "2023-04-27T14:00:00Z",
            "stressProfile": {
                "id": "1",
                "name": "24/7",
                "maxHoursPerShift": 24,
                "maxHoursPerPeriod": 168,
                "maxDaysPerPeriod": 7,
                "maxHoursPerDay": 24,
                "gapHoursBetweenShifts": 0,
                "createdAt": "2009-06-11T07:20:47Z",
                "modifiedAt": "2012-10-04T09:12:18Z"
            },
            "trainingRecords": [],
            "higherDuty": false,
            "role": {
                "id": "50"
            },
            "allowAppraisal": true,
            "history": "115659",
            "workplaces": [
                {
                    "id": "673",
                    "location": {
                        "id": "1"
                    },
                    "sortOrder": 0,
                    "agreement": {
                        "id": "672",
                        "payCenter": {
                            "id": "1"
                        },
                        "active": true,
                        "startDate": "2023-04-27T14:00:00Z",
                        "payPeriod": "1",
                        "history": "3960",
                        "createdAt": "2023-04-28T03:26:01Z",
                        "modifiedAt": "2023-04-28T03:26:01Z"
                    },
                    "createdAt": "2023-04-28T03:26:01Z",
                    "modifiedAt": "2023-04-28T03:26:01Z"
                }
            ],
            "createdAt": "2023-04-28T03:26:01Z",
            "modifiedAt": "2023-04-28T03:26:01Z"
        }
    }
}

Data Elements

Data ElementMandatoryInfo
strFirstNameYesFirst name of the employee
strLastNameYesLast name of the employee
displayNameYesHow the employees name should be displayed in Deputy
positionNoThe employees position in the company, also known as the role in Deputy. This can be the following:

- Employee
- Supervisor
- Location Manager
- System Administrator

Note: For Enterprise this can be the name of any role within the Deputy install.
primaryLocationNoObject which contains information about the primary location for the employee
primaryLocation - idNoAn integer which represents the id of the primary location for the employee
contact - objectNoThis object contains information about the contact details for the employee.
contact - email1NoThe primary email for the employee
contact - phone1NoThe primary phone number for the employee
contact - phone2NoThe secondary phone number for the employee
contact - notesNoNotes for the employees profile
contact - webNoThe website for the employee
contact - faxNoThe fax number for the employee
mainAddress - objectNoThis object has information related to the employees primary address
mainAddress - contactNameNoThe main contact name related to the employees main address
mainAddress - unitNoNoThe unit number for the address
mainAddress - streetNoNoThe street number for the address
mainAddress - suiteNoNoThe suite number for the address
mainAddress - poBoxNoThe po box number for the address
mainAddress - streetNoThe first street details for the address
mainAddress - street2NoThe second street details for the address
mainAddress - suburbNoThe suburb details for the address
mainAddress - countryNoThe id in Deputy which represents the country the address is for
mainAddress - stateNoThe id in Deputy which represents the state the address is for
mainAddress - postcodeNoThe postcode for the address
mainAddress - phoneNoThe phone for the address
mainAddress - notesNoAny notes related to the address
mainAddress - formatNoAlways 1
emergencyAddress ObjectNoThis object contains information about the address for the emergency details contact for the employee
emergencyAddress - contactNameNoThe contact name for the emergency address
formatNoAlways 1
emergencyAddress - phoneNoThe phone number for the emergency address
postalAddress - objectNoThis object contains details about the postal address for the employee
postalAddress - unitNoNoThe unit number related to the postal address
postalAddress - contactNameNoThe contact name related to the postal address
postalAddress - streetNoNoThe street number related to the postal address
postalAddress - suiteNoNoThe suite number related to the postal address
postalAddress - poBoxNoThe post office box related to the postal address
postalAddress - streetNoThe first street related to the postal address
postalAddress - street2NoThe second street related to the postal address
postalAddress - suburbNoThe suburb related to the postal address
postalAddress - countryNoThe id in the Deputy database related to the country of the postal address
postalAddress - stateNoThe id in the Deputy database related to the state of the postal address
postalAddress - postcodeNoThe postcode related to the postal address
postalAddress - phoneNoThe phone number related to the postal address
postalAddress - notesNoThe notes related to the postal address
postalAddress - formatNoAlways 1
gender - objectNoThis object contains information related to the employees gender
genderId - genderNoThe id of the gender related to the employee.
pronouns - objectNoThis object contains information related to the employees pronouns
pronouns - pronounsIdNoContains the employees pronouns. Can be He/Him, She/Her, Them/They
customPronounsNoIf the employee has custom pronouns set this will be added here
higherDutyNoBoolean. Whether the employee has a higher duty or not.
dateOfBirthNoThe employees data of birth in YYYY-MM-DD format
startDateNoThe employees start date in YYYY-MM-DD format
workplaces - ArrayNoContains an array of all the workplaces (locations) the employee is related to in the Deputy install
workplaces - location objectNoThis object contains information about a location in the Deputy install related to the employee. There can be multiple of these within the workplaces array if the employee has more than one location set in the Deputy install.
workplaces - location - idNoThe id of the location within the Deputy install related to this workplace object
workplaces - agreement objectNoThis object contains information about the agreement related to that workplace (location) for the employee within the Deputy install
workplaces - agreement - payrollidNoThe payroll id related to this agreement for the employee
workplaces - agreement - contract - contractIdNoThis is the id of the employment contract related to this employee when working in this workplace (location) in the Deputy install
trainingRecords - arrayNoContains information about training records related to the employee in the Deputy install
trainingRecords - module
trainingRecords - isActiveNoBoolean true/false. Whether the training record is currently considered valid within the employees record. For example has not expired
trainingRecords - trainingDateNoWhen the training was completed. YYYY-MM-DD format.
trainingRecords - expiryDateNoWhen the current training record is due to expire. YYYY-MM-DD format.
trainingRecords - commentNoThe current comments against the training record
stressProfile - objectNoContains information about the stress profile currently assigned to the employee
stressProfile - idNoThe id of the stress profile currently linked to the employee in the Deputy install.
externalIdNoThis field allows you to set a string which you can use to relate back to your own system for easy data matching. For example you might include the unique GUID record from your own system for this employee in this field, to assist in future data matching.

Employee API V1

Documentation relating to the old employee API Version 1 can be found here Employee API V1