⏱️ Time Entries API

Track billable and non-billable time for cases. Time entries can be linked to cases and later included in invoices.

Time Entry Object

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "description": "Research on case precedents",
  "date": "2026-01-15",
  "hours": 2.5,
  "hourlyRate": 150.00,
  "billable": true,
  "billed": false,
  "caseId": "case-uuid-here",
  "userId": "user-uuid-here",
  "firmId": "firm-uuid-here",
  "createdAt": "2026-01-15T14:30:00Z"
}

Fields

FieldTypeDescription
idstringUnique identifier (UUID)
descriptionstringDescription of work performed
datedateDate work was performed (YYYY-MM-DD)
hoursdecimalDuration in hours (e.g., 1.5 = 1h30m)
hourlyRatedecimalRate per hour in EUR
billablebooleanWhether time can be billed
billedbooleanWhether time has been invoiced
caseIdstringAssociated case ID
userIdstringUser who logged the time

List Time Entries

GET /api/time

Query Parameters

ParameterTypeDescription
caseIdstringFilter by case ID
billedbooleanFilter by billed status

Example

GET /api/time?caseId=abc123&billed=false

Response:
{
  "success": true,
  "data": [
    {
      "id": "...",
      "description": "Client meeting",
      "hours": 1.5,
      ...
    }
  ]
}

Get Time Entry

GET /api/time/{id}

Create Time Entry

POST /api/time

Request Body

{
  "description": "Drafting contract",
  "date": "2026-01-15",
  "hours": 3.0,
  "hourlyRate": 150.00,
  "billable": true,
  "caseId": "case-uuid-here"
}

Response

{
  "success": true,
  "data": {
    "id": "newly-generated-uuid",
    "description": "Drafting contract",
    "hours": 3.0,
    "userId": "your-user-id",
    "createdAt": "2026-01-15T10:30:00Z",
    ...
  }
}

Update Time Entry

PUT /api/time/{id}

Request Body

{
  "description": "Drafting and reviewing contract",
  "date": "2026-01-15",
  "hours": 3.5,
  "hourlyRate": 150.00,
  "billable": true,
  "caseId": "case-uuid-here"
}

Mark as Billed

POST /api/time/{id}/bill

Marks a time entry as billed. Typically called automatically when creating an invoice.

Response

{
  "success": true,
  "data": {
    "id": "...",
    "billed": true,
    ...
  }
}

Delete Time Entry

DELETE /api/time/{id}

Get Statistics

GET /api/time/stats

Returns aggregate time statistics for your firm.

Response

{
  "totalHours": 245.5,
  "totalAmount": 36825.00,
  "unbilledHours": 42.0,
  "unbilledAmount": 6300.00
}

← Back to API Overview