Help Center

Send punches with the Mark Attendance API

Record employee check-ins and check-outs from your own system with the Mark Attendance API, and understand its responses and errors.

Admins & HR Updated 25 Oct 2026
On this page

The Mark Attendance API lets your own system record a punch for an employee, just like a clock-in on a biometric device. This article is for the admin or developer setting up the integration.

Before you start

  • Create an API key — see Create and manage API keys.
  • Know each employee's employee code in Attendex (for example EMP010). The API finds employees by this code.
  • Only current employees (active, on probation or serving notice) can be punched.

Make a request

  1. Send a POST request to /api/mark-attendance on your Attendex address. The exact URL is shown in the Code Examples tab on the API & Integrations page ( open API & Integrations).
  2. Pass your key in the X-API-Key header, or as Authorization: Bearer <key>.
  3. Send a JSON body (form fields also work) with these fields:
FieldRequiredDescription
employee_codeYesThe employee's code, for example EMP010
punch_typeYesin for check-in or out for check-out
punch_timeNoYYYY-MM-DD HH:MM:SS. Defaults to now. Must be within the last 7 days and not in the future
curl -X POST https://yourcompany.attendex.in/api/mark-attendance \
  -H "X-API-Key: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"employee_code": "EMP010", "punch_type": "in"}'

What a successful response contains

A 200 response has "success": true, a message such as "Punch recorded at 09:15 AM", and a data object with the attendance date, first punch in, last punch out, day status, late and early-leaving minutes, worked minutes and overtime minutes.

How punches become attendance

Every punch is stored, then the whole day is recalculated using the employee's shift. punch_type is a hint: the first punch of the day counts as check-in and the last as check-out. See Attendance & shifts.

Errors

CodeWhat it meansWhat to do
400employee_code or punch_type missing or invalid, or punch_time out of rangeFix the request body
401API key missing or invalidCheck the header and the key
403Key deactivated, IP not allowed, company inactive, or API & Integrations not in your planTurn the key on, check the IP lists, or contact Attendex
404No current employee with that codeCheck the employee code in Attendex
405Not a POST requestUse POST
409Duplicate punch — the same employee punched moments ago — or the punch couldn't be recordedUsually safe to ignore duplicates
429Rate limit exceeded, or too many failed key attemptsSlow down, or raise the key's rate limit

Every call, successful or not, is counted on the API dashboard, so you can spot problems in Error Code Distribution.

Still stuck? Email info@cybexinnovation.com or WhatsApp +91 89277 73048.