Quickstart
- An admin creates a key in Settings → API Keys, choosing only the scopes the integration needs.
- Check the connection:
curl https://zira-hr.com/api/v1/me \
-H "Authorization: Bearer $ZIRA_API_KEY"List employees changed since your last sync, then follow nextCursor:
curl "https://zira-hr.com/api/v1/employees?updatedSince=2026-11-01T00:00:00Z&limit=100" \
-H "Authorization: Bearer $ZIRA_API_KEY"Create an employee safely (retries with the same key never create duplicates):
curl -X POST https://zira-hr.com/api/v1/employees \
-H "Authorization: Bearer $ZIRA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2a7e-0d5b-4c4e-9a52-1b2f0c3d4e5f" \
-d '{"employeeNumber":"EMP-1042","externalId":"ERP-88123","firstName":"Amina","lastName":"Otieno",
"employmentType":"PERMANENT","basicSalary":85000,"hireDate":"2026-12-01"}'Authentication & scopes
Send the key as a bearer token over HTTPS. Keys are 192-bit random, stored only as a hash, can expire, and are refused from networks outside the workspace IP allow-list. Every write is recorded in the audit log against the key.
| Scope | Grants |
|---|---|
| employees:read | Read employee records (no bank, ID or tax numbers unless employees:read_sensitive). |
| employees:read_sensitive | Also return KRA PIN, national ID, NSSF/SHIF numbers and bank details. |
| employees:write | Create and update employee records. |
| org:read | Read departments and job titles. |
| org:write | Create departments and job titles. |
| payroll:read | Read payroll runs, per-employee results and the general-ledger journal. |
| leave:read | Read leave types and leave requests. |
| leave:write | Submit leave requests. |
| events:read | Read the integration event log (polling alternative to webhooks). |
Payroll and sensitive-data scopes can only be granted by a payroll admin. API access is part of plans that include the Integrations module.
Conventions
- Base URL
https://zira-hr.com/api/v1. JSON in, JSON out, UTF-8. - Pagination: lists return
{ data, hasMore, nextCursor }.limitdefaults to 50 (max 200). - Delta sync:
updatedSinceon employees and leave requests,lockedSinceon payroll runs. - Idempotency: send
Idempotency-Keyon every POST. A retry within 24 hours replays the first response withIdempotent-Replayed: true. - Rate limits: 600 requests/minute per key. Responses carry
RateLimit-Limit,RateLimit-RemainingandRateLimit-Reset; a 429 carriesRetry-After. - Money is a decimal string (
"85000.00") with an ISO 4217currency; never parse it as a float. Dates are ISO 8601. - Mapping: store your system's ID in
externalIdand match on it, never on names. - Tracing: every response has
X-Request-Id(yours is echoed if you send one).
Errors
Errors use RFC 9457 problem details with a stable code:
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
{ "type": "https://zira-hr.com/developers#error-insufficient_scope",
"title": "Insufficient scope", "status": 403, "code": "insufficient_scope",
"detail": "This API key needs the \"payroll:read\" scope.", "requiredScope": "payroll:read" }| unauthorized | 401 | No key, or the key is invalid, revoked or expired. |
| insufficient_scope | 403 | The key lacks the scope named in requiredScope. |
| ip_not_allowed | 403 | The workspace IP allow-list does not include your egress IP. |
| forbidden | 403 | Plan, subscription or permission does not allow this call. |
| not_found | 404 | No such record in this workspace. |
| conflict | 409 | Duplicate unique value (employee number, external ID) or seat limit reached. |
| validation_failed | 422 | See errors[] for each field. |
| idempotency_key_reused | 422 | Same Idempotency-Key, different body. |
| rate_limited | 429 | Wait Retry-After seconds. |
| internal_error | 500 | Retry with exponential back-off; quote X-Request-Id to support. |
Webhooks
Add endpoints in Settings → Webhooks. Deliveries follow the Standard Webhooks spec: verify webhook-signature, reject timestamps older than 5 minutes, return 2xx within 10 seconds, and dedupe on webhook-id. Failures retry with back-off for about 3 days. Every event is also available from GET /events for 30 days.
| employee.created | An employee record was created. |
| employee.updated | An employee record changed (profile, job, department or pay). |
| employee.archived | An employee was deactivated / exited. |
| payroll_run.approved | A payroll run was approved and is ready to lock. |
| payroll_run.locked | A payroll run was locked. Its figures and GL journal are now final — post it to your ERP. |
| leave_request.created | A leave request was submitted. |
| leave_request.approved | A leave request was approved. |
| leave_request.rejected | A leave request was rejected. |
| leave_request.cancelled | A pending or upcoming approved leave request was cancelled, and any days charged were credited back. |
| webhook.test | Sent from the dashboard to check an endpoint. Safe to ignore. |
Node.js (or use the standardwebhooks package in Node, Python, Go, Java, C#, PHP, Ruby, Rust):
import crypto from 'node:crypto'
export function verify(secret, headers, rawBody) {
const id = headers['webhook-id'], ts = headers['webhook-timestamp']
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64')
const expected = crypto.createHmac('sha256', key).update(`${id}.${ts}.${rawBody}`).digest()
return headers['webhook-signature'].split(' ').some((part) => {
const sig = Buffer.from(part.split(',')[1] ?? '', 'base64')
return sig.length === expected.length && crypto.timingSafeEqual(sig, expected)
})
}Python:
import base64, hashlib, hmac, time
def verify(secret: str, headers: dict, raw_body: bytes) -> bool:
msg_id, ts = headers["webhook-id"], headers["webhook-timestamp"]
if abs(time.time() - int(ts)) > 300:
return False
key = base64.b64decode(secret.removeprefix("whsec_"))
expected = hmac.new(key, f"{msg_id}.{ts}.".encode() + raw_body, hashlib.sha256).digest()
return any(hmac.compare_digest(base64.b64decode(p.split(",", 1)[1]), expected)
for p in headers["webhook-signature"].split(" ") if "," in p)Connecting your ERP
The usual pattern: HR master data flows from Zira to the ERP (employees, departments as cost centres), and on payroll_run.locked the ERP posts the payroll journal. Map your chart of accounts once in Settings → General Ledger.
SAP S/4HANA & Business One
Payroll: download the `sap_s4` journal (or pull it from the API in SAP Integration Suite / CPI) and post with "Upload General Journal Entries". Master data: import the OpenAPI spec into Integration Suite and map /employees to Business Partner or HR master. B1 users map the same columns in DTW.
Microsoft Dynamics 365 (Business Central, Finance & Operations)
Payroll: `dynamics_bc` journal into a General Journal batch, or a Power Automate flow that receives payroll_run.locked and calls the journal endpoint. The OpenAPI file works as a Power Platform custom connector.
Oracle NetSuite
`netsuite` CSV via Import Assistant (External ID keeps re-imports idempotent), or a SuiteScript / Celigo flow that polls /payroll-runs?status=LOCKED&lockedSince=… and posts the JSON journal.
Odoo
`odoo` CSV import into Journal Entries, or an Odoo server action / n8n flow on payroll_run.locked. Set Employee.externalId to the Odoo hr.employee ID.
ERPNext / Frappe
`erpnext` Data Import file, or a Frappe webhook receiver that creates a Journal Entry from the JSON journal. Department codes map to Cost Centers.
Sage (50, 200, Intacct)
`sage50` audit-trail import or `sage_intacct` journal import. Intacct users can also post the JSON journal through its Web Services API.
QuickBooks Online, Xero, Zoho Books
Use the matching journal CSV. QuickBooks and Zoho match accounts by name, so fill the account-name column in Settings → General Ledger.
Custom / in-house ERP or data warehouse
Use the REST API with `updatedSince` for delta sync, webhooks (or /events) for change notification, and the `json` or `csv` journal. Generate a typed client from the OpenAPI file with openapi-generator, NSwag or Kiota.
iPaaS (MuleSoft, Boomi, Workato, Make, n8n, Zapier)
Import the OpenAPI 3.1 file as a connector; use "Webhook" triggers with signature verification for real-time flows.
Payroll journal formats
Each run produces one balanced journal: Dr gross pay and employer contributions; Cr PAYE, statutory liabilities, advance and loan recoveries and net pay. Get it from GET /payroll-runs/{id}/journal?format=… or download it in the dashboard.
| format | System | Import with |
|---|---|---|
| csv | Any ERP / custom system | One row per journal line with account code, cost centre, debit and credit. Map the columns in your import tool. |
| json | Custom integrations | Same structure as GET /api/v1/payroll-runs/{id}/journal. Post it with your own middleware. |
| quickbooks | Intuit QuickBooks Online | Settings → Import data → Journal entries. Account names must match your chart of accounts. |
| xero | Xero | Accounting → Manual journals → Import. Uses account codes; tracking category "Department" when split by cost centre. |
| sage50 | Sage 50 Accounts (audit trail import) | File → Import → Audit trail transactions. JD/JC journal rows, tax code T9. |
| sage_intacct | Sage Intacct | Company → Setup → Import data → General Ledger → Journal entries. Set the journal symbol (default GJ). |
| odoo | Odoo Accounting (account.move import) | Accounting → Journal Entries → Favourites → Import records. Account column takes the account code. |
| erpnext | ERPNext Journal Entry (Data Import) | Data Import → Journal Entry → Insert new records. Set the company name; cost centres must exist. |
| dynamics_bc | Microsoft Dynamics 365 Business Central | General Journals → Edit in Excel / configuration package. Department code goes to Shortcut Dimension 1. |
| sap_s4 | SAP S/4HANA (Upload General Journal Entries, F2548) | Fiori app "Upload General Journal Entries". Set company code; SAP Business One users map the same columns in DTW. |
| netsuite | Oracle NetSuite (CSV import: Journal Entry) | Setup → Import/Export → Import CSV records → Transactions → Journal Entry. External ID makes re-imports safe. |
| zoho_books | Zoho Books (manual journal import) | Accountant → Manual Journals → Import. Account names must match your chart of accounts. |
Layouts follow each vendor's published import template. If your instance has extra mandatory columns, use csv or json and map them in your import tool.
Identity: SSO & SCIM
Enterprise workspaces can sign in through any OpenID Connect provider (Microsoft Entra ID, Google Workspace, Okta, Auth0) after proving domain ownership with a DNS TXT record, and can provision users from the identity provider with SCIM 2.0 (RFC 7643/7644) at https://zira-hr.com/api/scim/v2. Configure both in Settings → Single Sign-On.
Versioning & support
- Current version:
2026-11-01(sent asZira-Api-Version). New fields, endpoints and event types may appear at any time — ignore what you don't recognise. - Breaking changes ship as a new version, announced at least 12 months before the old one is retired.
- The machine-readable contract is openapi.json — import it into Postman, Swagger UI or your iPaaS.
- Questions or a format we don't cover yet: contact support with your
X-Request-Id.