Clock in on an active job or an unfinished visit
POST/api/v1/time_entries/clock_in
One running timer per person across work and assessments. Supply exactly one of job_id or visit_id; startVisit with track_time does this in one step. An optional client UUID and recorded start time allow reliable offline replay. A technician must be assigned to the target. Assessment time is kept separate from work and is not billed automatically.
- Needs an API key, and runs with the access of the member who made the key.
- Send an
Idempotency-Key. The same key with the same request within 24 hours gives the first answer again and changes nothing. - A connected AI assistant can use it too, as
clockIn.
Parameters
Headers
Idempotency-KeystringrequiredUnique user-scoped key for safely retrying this mutation for 24 hours.
At least 1 character. Up to 200 characters.
Request body
Sent as application/json.
time_entryobjectrequiredSupply exactly one of job_id or visit_id (a work visit or a quote assessment).
Fields(5)
idstring (uuid)job_idstring (uuid)visit_idstring (uuid)started_atstring (date-time)notesstring or nullUp to 5000 characters.
Responses
201Recorded job time, including the current elapsed duration.
dataobjectrequiredFields(19)
lock_versionintegerrequiredAt least 0.
created_atstring (date-time)requiredupdated_atstring (date-time)requiredidstring (uuid)requiredaccount_idstring (uuid)requiredjob_idstring (uuid) or nullrequiredjob_titlestring or nullrequiredjob_numberstring or nullrequiredvisit_idstring (uuid) or nullvisit_titlestring or nullpurposestring`work` for job and work-visit time, `quote_assessment` for quote visit time.
One of: work, quote_assessment.
membership_idstring (uuid)requiredmembership_namestringrequiredrecorded_by_idstring (uuid)requiredupdated_by_idstring (uuid)requiredstarted_atstring (date-time)requiredended_atstring (date-time) or nullrequiredduration_secondsintegerrequiredAt least 0.
notesstring or null
A refusal answers in the one error shape every operation shares.
Example
A request our own tests send. The ids are made up: put your own in their place.
curl -X POST "https://app.tradesender.co.uk/api/v1/time_entries/clock_in" \
-H "Authorization: Bearer $TRADESENDER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"time_entry": {
"job_id": "4088bebb-3a71-586f-922c-1612b3fa6557"
}
}'