GraphQL
Authentication
Refer to Authentication Mechanisms on how to obtain a bearer token to query GraphQL
Schema
GraphQL Schema. This link also includes a playground for you to test queries
Best Practices
- Only request the data you need - Utilise the
sliceto specify the columns you require - Use paging to request data in chunks - Use the
startRowandendRowproperties - Make use of aggregations to group and summarize data - Use the
rowGroupsproperties to define how to group the rows, and theaggFuncin the columns to defined the aggregation. You can also make use of thetotalsOnlyto get the totals of the query without needing to page the data
Sample Queries
Get June 2025’s work items with an entry date in a given date period
curl --location 'http://api.alpha.lfms.dev/<your sandbox tenant alias>/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <Your Auth Token>' \
--data '{
"operationName": "GetRows",
"variables": {
"criteria": {
"entryPeriod": {
"fixedPeriod": { "min": "2025-06-01", "max": "2025-06-30"},
"relativePeriod": null
},
"includeDeleted": null,
"noMatter": false,
"workItemTypes": [],
"states": []
},
"slice": {
"cols": [
{
"colId": "entryDate"
},
{
"colId": "matterNumber"
},
{
"colId": "matterId"
},
{
"colId": "employeeSortName"
},
{
"colId": "employeeId"
},
{
"colId": "state"
},
{
"colId": "itemType"
},
{
"colId": "taskTypeName"
},
{
"colId": "title"
},
{
"colId": "rate"
},
{
"colId": "units",
"aggFunc": "sum"
},
{
"colId": "unitDuration",
"aggFunc": "sum"
},
{
"colId": "totalBase",
"aggFunc": "sum"
},
{
"colId": "durationTicks"
}
],
"startRow": 0,
"endRow": 50,
"sortBy": [
{
"colId": "entryDate",
"desc": true
}
],
"rowGroups": [],
"groupKeys": [],
"pivots": [],
"totalsOnly": false,
"filterZero": false,
"filterZeroField": null,
"groupLeafLevel": false
}
},
"query": "query GetRows($criteria: WorkItemCriteriaInput, $slice: AggregationSliceSpecInput) { work_item_listing(criteria: $criteria, slice: $slice) }"
}'Sample response
{
"data": {
"work_item_listing": [
{
"entryDate": "2025-06-27T22:37:07.000+10:00",
"matterNumber": "34",
"matterId": "d00639c4dc6b4b11a7002743316a6fa3",
"employeeSortName": "Smith, John",
"employeeId": "c7d7359affb94552b6d0b7469a072396",
"state": "Finalised",
"itemType": "Timed Fee",
"taskTypeName": null,
"title": "Conducted a deposition of the defendant in the case of Brown v. Green Enterprises.",
"rate": 300.0000000000,
"units": 10.0000000000,
"unitDuration": 1.00000000000000,
"totalBase": 300.0000000000,
"durationTicks": 36000000000
},
{
"entryDate": "2025-06-18T21:33:49.000+10:00",
"matterNumber": "32",
"matterId": "d7dd16847823472dbc2af045a4e08621",
"employeeSortName": "Smith, John",
"employeeId": "c7d7359affb94552b6d0b7469a072396",
"state": "Billed",
"itemType": "Timed Fee",
"taskTypeName": null,
"title": "Reviewed opposing counsel's discovery responses and drafted follow-up questions.",
"rate": 300.0000000000,
"units": 10.0000000000,
"unitDuration": 1.00000000000000,
"totalBase": 300.0000000000,
"durationTicks": 36000000000
},
{
"entryDate": "2025-06-13T21:18:31.000+10:00",
"matterNumber": "32",
"matterId": "d7dd16847823472dbc2af045a4e08621",
"employeeSortName": "Smith, John",
"employeeId": "c7d7359affb94552b6d0b7469a072396",
"state": "Finalised",
"itemType": "Timed Fee",
"taskTypeName": null,
"title": "Drafted client memorandum on potential liability issues in the case of XYZ Corp v. Doe.",
"rate": 300.0000000000,
"units": 10.0000000000,
"unitDuration": 1.00000000000000,
"totalBase": 300.0000000000,
"durationTicks": 36000000000
},
{
"entryDate": "2025-06-09T00:18:08.000+10:00",
"matterNumber": "34",
"matterId": "d00639c4dc6b4b11a7002743316a6fa3",
"employeeSortName": "Smith, John",
"employeeId": "c7d7359affb94552b6d0b7469a072396",
"state": "Billed",
"itemType": "Timed Fee",
"taskTypeName": null,
"title": "Drafted a motion for summary judgment in the case of Smith v. Johnson.",
"rate": 300.0000000000,
"units": 10.0000000000,
"unitDuration": 1.00000000000000,
"totalBase": 300.0000000000,
"durationTicks": 36000000000
},
{
"entryDate": "2025-06-07T23:17:53.000+10:00",
"matterNumber": "32",
"matterId": "d7dd16847823472dbc2af045a4e08621",
"employeeSortName": "Smith, John",
"employeeId": "c7d7359affb94552b6d0b7469a072396",
"state": "Finalised",
"itemType": "Timed Fee",
"taskTypeName": null,
"title": "Reviewed client's case file and legal documents for upcoming trial preparation.",
"rate": 300.0000000000,
"units": 10.0000000000,
"unitDuration": 1.00000000000000,
"totalBase": 300.0000000000,
"durationTicks": 36000000000
},
{
"entryDate": "2025-06-05T03:39:03.000+10:00",
"matterNumber": "32",
"matterId": "d7dd16847823472dbc2af045a4e08621",
"employeeSortName": "Smith, John",
"employeeId": "c7d7359affb94552b6d0b7469a072396",
"state": "Finalised",
"itemType": "Timed Fee",
"taskTypeName": null,
"title": "Drafted a motion for summary judgment in the case of Smith v. Johnson.",
"rate": 300.0000000000,
"units": 10.0000000000,
"unitDuration": 1.00000000000000,
"totalBase": 300.0000000000,
"durationTicks": 36000000000
}
]
}
}Get fees entered, billed and written off for an employee
curl --location 'http://api.alpha.lfms.dev/<your sandbox tenant alias>/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <Your Auth Token>' \
--data '{
"operationName": "GetRows",
"variables": {
"criteria": {
"period": { "min": "2025-06-01", "max": "2025-06-30"},
"periodRelativeTo": null,
"relativePeriod": "TODAY",
"feeEarnerId": "employee_c7d7359affb94552b6d0b7469a072396"
},
"slice": {
"cols": [
{
"colId": "feeEarnerSortName"
},
{
"colId": "workItemFinalised",
"aggFunc": "sum"
},
{
"colId": "workItemFinalisedUnits",
"aggFunc": "sum"
},
{
"colId": "workItemBilled",
"aggFunc": "sum"
},
{
"colId": "workItemBilledUnits",
"aggFunc": "sum"
},
{
"colId": "workItemWrittenOff",
"aggFunc": "sum"
},
{
"colId": "workItemWrittenOffUnits",
"aggFunc": "sum"
}
],
"startRow": 0,
"endRow": 50,
"sortBy": [
{
"colId": "feeEarnerSortName",
"desc": false
}
],
"rowGroups": [
{
"colId": "feeEarnerSortName"
},
],
"groupKeys": [],
"pivots": [],
"totalsOnly": false,
"filterZero": false,
"filterZeroField": null,
"groupLeafLevel": false
}
},
"query": "query GetRows($criteria: FeeAnalysisFactCriteriaInput, $slice: AggregationSliceSpecInput) { fee_analysis(criteria: $criteria, slice: $slice) }"
}'Sample Response
{
"data": {
"fee_analysis": [
{
"feeEarnerSortName": "Smith, John",
"workItemFinalised": 1800.0000000000,
"workItemFinalisedUnits": 60,
"workItemBilled": 300.0000000000,
"workItemBilledUnits": 10,
"workItemWrittenOff": 0.0000000000,
"workItemWrittenOffUnits": 0
}
]
}
}