Microkeeper API
The Microkeeper API lets your software read and write a Microkeeper account's data, such as staff, rosters, timesheets, leave and pay runs. Every request goes to one address, with two keys: a developer key that identifies your software, and a business key that identifies the account and what you may do in it.
| Required plan | All plans |
|---|---|
| To make API keys | Settings |
This guide covers how to:
- Make your API keys.
- Send a request.
- Read the response and errors.
- Check the access each action needs.
- Log your requests while you build.
Make your API keys
Register a Microkeeper account for your software, if you don't have one. In Menu > Settings > General > Global, under Business Contact, fill in the Business Name: customers see it when your software reaches their account, and requests are refused while it's blank.
Your developer key: mk_dev_key
- Navigate to Menu > Settings > General > Global, then Developers.
- Beside Developer Key, click Manage Developer API Keys. It opens in a new tab.
- Click Create New API Key, enter the Name of Application, and click Generate API Key.
- Click Copy to Clipboard, and store the key on your server.
Your developer key is the same for every account you connect to. Keep it on your server: never put it in a browser, an app or code you share.
A business key for each account: mk_biz_key
Each account you connect to makes a business key for you, with the access your software needs. On that account:
- Navigate to Menu > Settings > General > Global, then Developers.
- Beside API Business Keys, click Manage Business API Keys.
- Click Create New API Key, and enter the API use case, such as your software's name.
- Under Access Permissions, choose No Access, Read Only or Read/Write for Roster, Payroll, HR/Staff and Account. Every module starts at No Access.
- Click Generate API Key, and copy the key.
Each key is shown once, when it's made. If one is lost, revoke it and make a new one. A business key's access can be changed later with Edit, and Revoke Key stops it working straight away.
Send a request to the Microkeeper API
Send every request as an HTTPS POST to:
https://microkeeper.com.au/api_post.phpwith these four form fields:
| Field | What it is | Example |
|---|---|---|
mk_dev_key | Your developer key, 32 letters and numbers | 3tsq34ta4tq2ars234rqr32tsatw4sq4 |
mk_biz_key | The account's business key, 32 letters and numbers. Store it for that account | 1o7ayfmp092rmkrds7et7s3e3cnq3wqr |
mk_action | The action, in lower case with underscores | get_roster |
mk_data | The action's data, as a JSON string. Send {} when an action needs none | {"start_date":"2026-06-01","end_date":"2026-06-07"} |
Send them form-encoded (application/x-www-form-urlencoded), with each value URL-encoded. The keys go in the form fields, not in headers.
Example in PHP
$post_data = [
'mk_dev_key' => getenv('MK_DEV_KEY'),
'mk_biz_key' => $account['mk_biz_key'],
'mk_action' => 'hello_world',
'mk_data' => json_encode(['hello' => 'world']),
];
$curl = curl_init('https://microkeeper.com.au/api_post.php');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
$response = json_decode(curl_exec($curl), true);
curl_close($curl);
if ($response['success'] !== '1') {
// $response['message'] says why
}Example with curl
curl https://microkeeper.com.au/api_post.php \
--data-urlencode "mk_dev_key=$MK_DEV_KEY" \
--data-urlencode "mk_biz_key=$MK_BIZ_KEY" \
--data-urlencode "mk_action=hello_world" \
--data-urlencode 'mk_data={"hello":"world"}'Test your connection with hello_world
Send hello_world with any JSON in mk_data. A working connection answers with the account it reached:
{"success":"1","authenticated":"1","message":"Hello World! Accessed: southerncross"}hello_world needs no access level, so it shows your keys work before you set up access.
Read the response
Every response is JSON with:
success:"1"if the action worked,"0"if not. It's a string.authenticated:"1"if both keys were accepted,"0"if not.message: what happened, or why it failed.data: the action's results, when it has any. Each action's guide shows itsdata.
Check success, not only the HTTP status: an action that can't be done answers HTTP 200 with "success":"0" and a message, such as "There is no timesheet data for this period".
Errors from the Microkeeper API
Problems with the request or keys answer with an HTTP error and "authenticated":"0":
| HTTP | Message | What to check |
|---|---|---|
| 400 | mk_biz_key, mk_dev_key, mk_action or mk_data field missing | All four fields are sent, as form fields |
| 400 | mk_biz_key or mk_dev_key is incorrect | Each key is the full 32 characters |
| 401 | mk_biz_key does not match a business | The business key is right, and hasn't been revoked |
| 401 | mk_dev_key does not match a developer key | The developer key is right, and hasn't been revoked |
| 401 | Business name in general settings is blank. Settings > General > Global to correct | Your own account's Business Name is filled in |
| 403 | Access denied for get_payroll | The business key has the access the action needs. See below |
Once the keys are accepted, other problems answer HTTP 200 with "success":"0":
mk_data is not correctly formatted JSON:mk_dataisn't valid JSON.Action unknown: get_everything: the action name is wrong.Global Settings not complete yet. Settings > General > Global to correct: the account hasn't finished its Global Settings, so nothing can run yet.- Each action's own messages, listed in its guide.
The access each action needs
A business key needs Read Only or Read/Write on the action's module. Read/Write includes Read Only.
| Module | Read Only | Read/Write |
|---|---|---|
| Roster | get_roster, get_timesheet | add_roster, add_timesheet |
| Payroll | get_payroll, get_payrun_list, get_leave | add_payroll |
| HR/Staff | get_employees, get_group_config, get_skill | upsert_employees |
| Account | get_locations, get_roles, get_jobs, get_abn_pay_cycle | upsert_locations, update_jobs, add_bank_details, upsert_abn_v2, upsert_pay_cycle_v2, upsert_access_user_pay_cycle |
Locations, Roles and Jobs are under Account, as they're part of the account's set-up. hello_world and create_account need no access level.
Log your requests while you build
On the account you're testing against, navigate to Menu > Settings > General > Global > Developers, and set API Logging to API Logging On - Accounts. Every request that reaches the account is then logged.
Open the log from API Logs on the Business or Developer API Keys page. It shows the last 1,000 requests from the past 30 days: each one's action, whether it worked, the first 1,000 characters of the request, and the message for those that failed. Type in Search API Logs to find a request. Turn logging off when you're done.
The Microkeeper API's actions
API Employee
Add, update and read staff, and Groups.
API Locations
Read and upsert Locations.
API Roles
Read Roles.
API Jobs
Read and update Jobs.
API Roster
Read rosters and replace shifts.
API Timesheet
Add and read timesheets.
API Leave
Read leave requests.
API Skills
Read skills and their status.
API Payroll
Process pay runs and read payslips.
API Accounts
For resellers: accounts, ABNs, pay cycles and bank accounts.