^Login

Upsert and get employee via developer API


This guide explains how to upsert (insert-or-update) and get employee data via the Microkeeper developer API.




Deprecation notice:
  • add_employees and update_employees are deprecated and replaced by upsert_employees.
  • auto_username is now always enforced for inserts in upsert_employees.
  • Manual eusername selection is no longer supported when creating new employees. Usernames are generated as firstname_lastnameX with X incremented until unique.
  • get_employees now returns additional data (see the "New in 2025 for get_employees" callout below).


Upserting Employees via API


Step 1

Before starting this tutorial make sure you have completed the Hello World tutorial.

Complete the hello_world tutorial Hello World




Step 2

Set the mk_action variable and mk_data variable.

Variable name
Value - Minimum requirement
mk_action

upsert_employees

mk_data
{ "Employees": [ { "EmployeeID":"emp_001", "firstname":"John", "lastname":"Smith", "email":"john@example.com", "phoneno":"0400123456", "super_fund":"RES0103AU", "welcome":"email" } ] }

Notes:

  • firstname and lastname are required in the payload.
  • To update an existing employee, include one of EmployeeID, EID or eusername. If the identifier matches an existing record, fields are updated; if EmployeeID is supplied and not found, a new employee is inserted.
  • Within a single payload, values for EmployeeID, EID and eusername must be unique. Duplicates cause an error.




Step 3

List of available fields (upsert)

The minimum fields required are firstname and lastname. For updates, include an identifier (EmployeeID, EID or eusername).

If a field is missing a default or blank value may be set. If an unknown format is supplied, the profile is still processed but that field may be skipped without error. Verify the data in the Microkeeper UI after upsert.


Variable NameDescriptionFormatExampleUpdatableGettable
EIDEmployee ID in Microkeeper (unique)Integer12345Yes (update match only)Yes
eusernameEmployee username (unique). auto_username enforcedStandardised "firstname_lastnameX"john_smithYes (update match only). New inserts auto-generateYes
EmployeeIDEmployee ID in 3rd party system (unique)Alphanumericemp_001Yes (update match or insert if not found)Yes
Unique identifier rules:
Any of EID, eusername, EmployeeID can be used to update.
If only EmployeeID is supplied and not found, a new record is inserted. If EID or eusername is supplied but does not exist, an error is returned.
firstnameGiven nameAlphaJohnYes (required)Yes
lastnameSurnameAlphaSmithYes (required)Yes
emailEmail (re-verification required on change)Emailjohn@example.comYesYes
phonenoMobile number (re-verification required on change)Numeric0400123456YesYes
home_noHome numberNumeric03 5211 2233YesYes
addressAddress line 1Alphanumeric1 Smith StYesYes
citySuburbAlphaBelmontYesYes
stateState (OTH for overseas)VIC,NSW,NT,QLD,SA,TAS,WA,OTHVICYesYes
postcodePostcodeNumeric3216YesYes
countryCountryAlphaAustraliaYesYes
timezoneTime zone (defaults from state if missing)IANA TZ (e.g., Australia/Victoria)Australia/VictoriaYesYes
dob2Date of birthdd/mm/yyyy or yyyy-mm-dd1970-11-23YesYes
startdate2Start datedd/mm/yyyy or yyyy-mm-dd2014-10-20YesYes
terdate2Termination datedd/mm/yyyy or yyyy-mm-dd2014-10-20YesYes
cessation_typeCessation TypeString (V,I,D,R,F,C,T)VYesYes
last_modifiedDate record last modifiedyyyy-mm-dd2025-10-31No (set by system)Yes
sexGenderF/M/I/O (and variants)MYesYes
ratePay rateDecimal ($)16.1943YesYes
RRNIDRate Rule Name IDInteger1234YesYes
taxTax scaleInteger (1,5,8,4)1YesYes
employment_overrideStatus OverrideString: "", D, L, N, VDYesYes
income_typeSTP Income Stream TypeString (SAW/WHM/etc.)WHMYesYes
tax_freeTax Free ThresholdBoolean1YesYes
helpHELP PAYGBoolean0YesYes
tslTrade Support LoanBoolean0YesYes
sfssStudent Financial Supplement SchemeBoolean0YesYes
senior_taxSeniors and Pensioners Tax OffsetBoolean0YesYes
tax_perFixed Tax percentageInteger (%)20YesYes
tax_addTax offset-1000 to +1000 ($)50YesYes
etfnTax File NumberNumeric321 321 321YesNo (exported as "set/not_set")
super_fundSuper Fund (accepts USI)USI / SPIN / NameRES0103AUYes (USI mapped to fund)Yes (as object)
super_noSuper Member NumberAlphanumeric655655655YesYes
open_balanceOpening balance by yearObject"open_balance": { "2024": { "al": 80, "sick": 16 }, "2025": { "al": 40 } }YesYes
leave_quotaLeave quotas by keyObject"leave_quota": { "toil": { "accrual_amount": 2.923, "payslip_hide": 0 } }YesYes
kin_nameNext of kin nameAlphaRogerYesYes
kin_noNext of kin phone numberNumeric03 5244 0011YesYes
eTitleBank title account 1StringMr John SmithYesYes
eBSB_ABank BSB account 1xxx-xxx / xxxxxx / xxxxx011-222YesYes
eAccountNoBank account number account 1Numeric123123123YesYes
split_paySplit pay to account 2String: "", fix, perfixYesNo
split_amountSplit amount to account 2Decimal (amount or %)200YesNo
eTitle2Bank title account 2StringMr John SmithYesNo
eBSB_BBank BSB account 2xxx-xxx / xxxxxx / xxxxx011-222YesNo
eAccountNo2Bank account number account 2Numeric111222333YesNo
split_pay3Split pay to account 3String: "", fix, pernulYesNo
split_amount3Split amount to account 3Decimal (amount or %)0YesNo
eTitle3Bank title account 3String
YesNo
eBSB_CBank BSB account 3xxx-xxx / xxxxxx / xxxxx011-222YesNo
eAccountNo3Bank account number account 3Numeric
YesNo
default_LIDDefault LocationInteger7656YesYes
default_ROIDDefault RoleInteger2343YesYes
default_jobDefault Job (ID from Job list)Integer1234YesNo
primary_managerUsername of primary managerStringjohn_smithYesNo
positionPosition of employeeStringCFOYesNo
show_sickShow PL on payslipBoolean1YesYes
show_annuShow Annual Leave on payslipBoolean1YesYes
show_longShow LSL on payslipBoolean1YesYes
show_rdoShow RDO/TIL on payslipBoolean1YesYes
super_on_loading
Should super be applied to Leave LoadingBoolean1YesYes
abnSub-Contractor ABN (if status = Sub-Contractor)Integer82004832237YesYes
businessnameSub-Contractor Business Name (if status = Sub-Contractor)StringABC Contractor Pty LtdYesYes
activeActive or TerminatedString: TRUE/FALSETRUENo (defaults active on add)Yes
entitledalEntitled annual leave weeksDecimal (weeks)4YesYes
entitledsickleaveEntitled personal leaveDecimal (weeks)2YesYes
leaveloadingAnnual leave loadingDecimal (%)17.5YesYes
rdoRostered day off hours deductedInteger (hours)2YesYes
entitled_longEntitled long service leaveDecimal (1 week in x)60YesNo
preyear Year pre-accumulated data is applied to
(Deprecated use open_balance)
Year (e.g., 2020 = 2020/21)2020YesNo
preacalPre-accumulated annual leave (Deprecated)Decimal (hours)123.32YesNo
pre_longPre-accumulated long service leave (Deprecated)Decimal (hours)123.32YesNo
pre_sickPre-accumulated personal leave (Deprecated)Decimal (hours)123.32YesNo
prerdoPre-accumulated RDO (Deprecated)Decimal (hours)123.32YesNo
pregrossPre-accumulated gross (Deprecated)Decimal ($)10000.22YesNo
presuperPre-accumulated super above statutory (Deprecated)Decimal ($)10000.22YesNo
pretaxPre-accumulated tax (Deprecated)Decimal ($)10000.22YesNo
prenetPre-accumulated net (Deprecated)Decimal ($)10000.22YesNo
basichoursBasic hoursDecimal (hours)38YesNo
salarySalary flagString: T/FTYesNo
statusEmployment statusFull Time / Casual / Part Time / Sub-Contractor / Subby-SuperFull TimeYesNo
superbasicSuper on basic-only vs incl. OTTRUE = OTE only; FALSE = OTE+OT0 = defaultYesNo
super_fix_typeFixed/Min/Max super overrideInteger: 0 Fixed, 1 Min, 2 Max0 (disabled)YesNo
super_fixedAmount for super_fix_typeDecimal ($)155.55YesNo
duplicate_checkChecks if a user already exists via emailString=emailemailYesNA
auto_usernameForce username format firstname_lastnameXBoolean (1/0)1YesNA
welcomeSend welcome message (on insert)sms | email | bothemailYes (insert only)NA
custom_{field}Active custom fields (e.g., custom_favourite_pizza)String / Date (yyyy-mm-dd)custom_favourite_pizzaYesYes


Many other fields remain supported as in the legacy table (banking accounts 2 & 3, super_fund_2..4, pre-accumulated fields, status, salary, etc.). Behaviour and formats are unchanged unless noted above.

Open Balance

These objects can be included per employee in upsert_employees to insert/update opening balances.


Object
Description
Example
open_balanceMap of year { open_key: amount }.
If present, upserted per (eusername,year,open_key).
"open_balance": { "2024": { "al": 80, "sick": 16 }, "2025": { "al": 40 } }


Supported open_key keys are:


KeyDescriptionUnitExample
alAnnual LeaveHours500
sickPersonal/Carer's (Sick) LeaveHours400
lslLong Service LeaveHours300
rdoRostered Day OffHours200
toilTime Off in Lieu (TIL)Hours100
offUnpaid LeaveHours0
comCompassionate LeaveHours0
pregrossGrossCurrency50,000
presuperSuperCurrency40,000
pretaxPAYG taxCurrency30,000
prenetNetCurrency20,000


Leave Quota


This tool is to be used along side custom leave type, where the employer add new leave types outside of the supplied standard list so:

Do not use for standard leave types:
  • Annual Leave "al"
  • Personal Leave "sick"
  • Long Service Leave "lsl"
  • Rostered Day Off "rdo"
  • Time Off In Lieu "toil"

TOIL does not have a fixed accrual amount.


Object
Description
Example
leave_quota
Map of leave_key { accrual_amount, payslip_hide }.
Upserted per (eusername,leave_key).
"leave_quota": { "toil": { "accrual_amount": 2.923, "payslip_hide": 0 }, "rdo": { "accrual_amount": 1.462 } }


Custom Fields

Custom fields are sent/returned as custom_{field}, e.g. custom_favourite_pizza.

  • Only active custom fields are processed.
  • Date-validated custom fields are exported as yyyy-mm-dd.
  • Unlimited fields supported.




Step 4

Response

The response will be JSON.

When employees are added or updated, the response includes the list of EID for affected records. If you passed your EmployeeID, it will be echoed with its EID.

Successful example

{ "success":"1", "authenticated":"1", "message":"User added or updated to Microkeeper", "data":{ "added":{"emp_001":68783}, "updated":{"EID":[12345,12346]} } }

Notes: On updates that matched an existing record, email/phone re-verification flags are reset if email or phoneno changed.

If nothing was added or updated, an error message is returned.




Get Employee data via API


Via last_modified

You can retrieve staff by last_modified (up to 365 days back) or use "active" to return only active staff.

Via user_list

Alternatively, supply a user_list with EmployeeID, EID, or eusername arrays to fetch specific users.


Step 1

Set the mk_action and mk_data variables.

Variable name
Values and Example
mk_action

get_employees

mk_data
{"config":{"last_modified":"2025-10-01"}}
or
{"config":{"last_modified":"active"}}
or
{"config":{"user_list":{"EmployeeID":["abc1","abc2"]}}}
or
{"config":{"user_list":{"EID":["111","222"]}}}
or
{"config":{"user_list":{"eusername":["jane_d","john_s"]}}}





Step 2

Review data standards

Refer to the upsert table for exported formats.

Sensitive fields (e.g. TFN) are not exported; instead, etfn will be set or not_set.

New in 2025 for get_employees:
  • EmployeeID is always present (blank string if not set historically) for easier 3rd-party mapping and updating.
  • open_balance is returned per employee as {"YYYY":{"al":hours,"sick":hours,...}}.
  • leave_quota is returned per employee as {"leave_key":{"accrual_amount":x.xxx,"payslip_hide":0|1}}.
  • groups now include GID and per (percentage allocation) for each group membership.
  • super_fund fields are expanded into objects including SFID, name, ABN, USI, and spin for each of up to four funds.
  • custom_* fields include all active custom fields; date-validated custom fields are normalised to yyyy-mm-dd.


super_fund array


Variable name
Description
Output format
Example
SFIDSuper Fund IDInteger111
nameCommon fund nameStringREST Employer
ABNAustralian Business Number (may be blank if not recorded)Number76514770399
USIUnique Super Identifier (not for SMSF)AlphanumericRES0103AU
spinSuperannuation Product Identification NumberAlphanumericAMP0278AU


groups array

Variable name
Description
Output format
Example
GIDGroup ID in MicrokeeperInteger111
perPercentage for cost centre tracking (0100)Decimal100


open_balance object

Key
Description
Format
Example
YYYYYear the opening balance applies toYear (e.g. 2025)2025
open_keyLeave key (e.g. al, sick)Stringal
open_amountOpening hours for that keyDecimal (hours)80.000


leave_quota object

Key
Description
Format
Example
leave_keyLeave key (e.g. al, sick)Stringal
accrual_amountAccrual hours amountDecimal (hours)2.923
payslip_hideHide balance on payslipBoolean (0/1)0




Response

Step 3

The format will be JSON.

A successful response might include no employees if no records matched your filters. The data field will include an employees array.

Successful example:


{
"success": "1",
"authenticated": "1",
"message": "2 staff retrieved from Microkeeper",
"data": {
"employees": [
{
"EID": "3",
"EmployeeID": "emp_001",
"eusername": "john_smith",
"firstname": "John",
"lastname": "Smith",
"...": "...",
"super_fund": {
"SFID": "482",
"name": "REST Employer Sponsored Division",
"ABN": "",
"USI": "RES0103AU",
"spin": "RES0103AU"
},
"groups": [
{ "GID": 111, "per": 100 }
],
"open_balance": {
"2024": { "al": 80, "sick": 16 }

"2025": { "sick": 80, "sick": 16 }
},
"leave_quota": {
"al": { "accrual_amount": 2.923, "payslip_hide": 0 }
}
}
]
}
}






Feature parity & removals
  • Manual username selection on insert is no longer supported.
  • auto_username is forced by design in upsert_employees.
  • Duplicate identifiers within a single payload (same EmployeeID, EID or eusername appearing twice) will cause the request to fail.


Updating email and mobile number

If email or phoneno is updated, Microkeeper will reset the verification flags and the employee will need to verify again.