1. Home
  2. Docs
  3. Labor Integration
  4. Create Time Punch Data
  5. POST Structure for /time_punches

POST Structure for /time_punches

Creating time punch data in 7shifts is handled through a POST request to the 7shifts /time_punches endpoint. Here’s an example:

Request URL

POST https://api.7shifts.com/v1/time_punches

Request body

{
	"time_punch": {
		"user_id": 246800,
		"role_id": 135790,
		"department_id": 98765,
		"location_id": 12345,
		"date": "2020-07-31",
		"clocked_in": "16:00:00"
	}
}

Response

{
    "status": "success",
    "data": {
        "time_punch": {
            "id": 1357924680
        }
    },
    "message": "Punch has been added"
}

Here’s an explanation of each of the fields required in the request body:

FieldTypeExplanation
user_idNumericThe 7shifts ID of the user clocking in (id field from the users response object)
role_idNumericThe ID of the role that the user is clocking in to work for
department_idNumericThe ID of the department that the user is clocking in at
location_idNumericThe ID of the location that the user is clocking in at
dateText/DateThe local date that the user clocked in on (format: YYYY-MM-DD)
clocked_inText/TimeThe local time that the user clocked in at (format: HH:MM:SS)