Skip to main content

Record completed time against a job, a work visit or a quote assessment

POST/api/v1/time_entries

  • 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 createTimeEntry.

Parameters

Headers

  • Idempotency-Keystringrequired

    Unique 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_entryobjectrequired

    Supply exactly one of job_id or visit_id (a work visit or a quote assessment). Time on a work visit also carries its job_id. The target cannot be changed after creation.

    Fields(8)
    • started_atstring (date-time)required

    • ended_atstring (date-time)required

    • notesstring or null

      Up to 5000 characters.

    • lock_versioninteger

      At least 0.

    • idstring (uuid)

    • job_idstring (uuid)

    • visit_idstring (uuid)

    • membership_idstring (uuid)

      Managers may record time for another active team member. Defaults to the current member.

Responses

201Recorded job time, including the current elapsed duration.

  • dataobjectrequired

    Fields(19)
    • lock_versionintegerrequired

      At least 0.

    • created_atstring (date-time)required

    • updated_atstring (date-time)required

    • idstring (uuid)required

    • account_idstring (uuid)required

    • job_idstring (uuid) or nullrequired

    • job_titlestring or nullrequired

    • job_numberstring or nullrequired

    • visit_idstring (uuid) or null

    • visit_titlestring or null

    • purposestring

      `work` for job and work-visit time, `quote_assessment` for quote visit time.

      One of: work, quote_assessment.

    • membership_idstring (uuid)required

    • membership_namestringrequired

    • recorded_by_idstring (uuid)required

    • updated_by_idstring (uuid)required

    • started_atstring (date-time)required

    • ended_atstring (date-time) or nullrequired

    • duration_secondsintegerrequired

      At 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" \
  -H "Authorization: Bearer $TRADESENDER_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "time_entry": {
    "job_id": "4088bebb-3a71-586f-922c-1612b3fa6557",
    "started_at": "2026-01-05T08:00:00Z",
    "ended_at": "2026-01-05T09:00:00Z"
  }
}'