LemuAIDocs

Tickets · 1 min read

Log Work

Record time spent on a LemuTickets ticket

Open in ChatGPTOpen in ClaudeMarkdown

Records time someone spent on a ticket. Logged time adds up in the ticket's time_spent_minutes and appears in reports, separately from how long the ticket was open.

POST/v1/tickets/{ref}/worklogs

Use a key with the tickets.write scope.

Path parameters#

NameTypeRequiredDescription
refstringYesThe ticket key (SUP-1042) or id.

Request body#

FieldTypeRequiredDescription
minutesintegerYesTime spent, 1 to 1440 (24 hours).
started_atstring (date-time)NoWhen the work started. Defaults to now.
notestringNoWhat was done.
billablebooleanNoWhether the time can be billed to the customer. Default false.
user_idstring (UUID)NoThe team member who did the work. Defaults to the caller: for an API key, the key's own user. Required with a client credentials token.

Example request:

cURL
curl -X POST https://api.tickets.lemuai.com/v1/tickets/SUP-1042/worklogs \
  -H "Authorization: Bearer ltk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "minutes": 45,
    "started_at": "2026-11-25T08:30:00+05:30",
    "note": "Checked the payment gateway logs and raised the refund.",
    "billable": false,
    "user_id": "0e2a4c6b-8d1f-4a3e-9b5c-7d9f1a3c5e7b"
  }'

This endpoint does not use idempotency keys. If you retry after a timeout, check the ticket's time_spent_minutes first so the time is not logged twice.

Response#

201

JSON
{
  "id": "b3d5f7a9-c1e2-4b6d-8f0a-2c4e6a8b0d2f",
  "minutes": 45,
  "total_minutes": 105
}
FieldTypeDescription
idstringThe worklog's id.
minutesintegerThe minutes logged by this request.
total_minutesintegerAll time logged on the ticket so far.

This fires the worklog.created webhook.

Errors#

StatuscodeWhen
404ticket_not_foundNo ticket with this key or id, or you cannot see it
422invalid_fieldsminutes is missing or not between 1 and 1440
422missing_userThe caller is not a user and no user_id was sent

Was this page helpful?