ZkTeco API Reference

This guide provides details on integrating with the ZkTeco API for managing employees, departments, devices, and attendance transactions.

Base URL: http://www.ZkTeco.in/api/

Authentication: All requests require a valid Authorization: Bearer <token> header.

1. Authentication

POST /api-token-auth/

Authenticate with username and password to receive a token.

{
  "username": "your_username",
  "password": "your_password"
}

Response:

{
  "token": "c8efd14a1f1a0a4be36b49e67452c65cfe6b88e0"
}

2. Personnel API

2.1 Employees

GET /personnel/api/employees/

List employees with pagination and search filters.

POST /personnel/api/employees/

Create new employee.

2.2 Departments

GET /personnel/api/departments/

Fetch all departments.

2.3 Positions

GET /personnel/api/positions/

Retrieve employee positions.

2.4 Areas

GET /personnel/api/areas/

List available areas.

2.5 Locations

GET /personnel/api/locations/

Get list of locations.

3. IClock API (Devices & Transactions)

3.1 Transactions

GET /iclock/api/transactions/

Retrieve employee attendance transactions.

3.2 Devices

GET /iclock/api/devices/

Fetch list of devices.

3.3 Device Commands

POST /iclock/api/devicecommands/

Send command to device (e.g., restart, sync).

3.4 Upload/Download Data

POST /iclock/api/upload/

Upload fingerprint templates, users, or other data.

GET /iclock/api/download/

Download data from server to device.

4. Standard Response Codes

{
  "code": 0,
  "message": "success",
  "data": {}
}
  • 0 – Success
  • 1 – Invalid Request
  • 401 – Unauthorized (Invalid Token)
  • 404 – Resource Not Found
  • 500 – Internal Server Error

5. Best Practices

  • Always include the token in the Authorization header.
  • Use pagination parameters (?page=1&page_size=20) when fetching lists.
  • Filter employees and transactions using query parameters for efficiency.
  • Secure API calls with HTTPS in production.