Skip to content

Get Timesheet

This endpoint returns one timesheet by ID, with all of its timecards and daily hours.

GET /v1/timesheets/timesheets/:id

Include your API key in the x-api-key header. See Authentication.

timesheets:read
ParameterTypeRequiredDescription
idstringYesTimesheet ID in the format <tenantId>#<userId>#<YYYYMMDD>_<YYYYMMDD>, URL-encoded. For example, tenant-123#user-a#20221231_20230106 becomes tenant-123%23user-a%2320221231_20230106. See Timesheet IDs.

This endpoint does not accept a request body.

Terminal window
curl "https://api.crewsum.com/v1/timesheets/timesheets/tenant-123%23user-a%2320221231_20230106" \
-H "x-api-key: $CREWSUM_API_KEY"

On success, the API returns HTTP 200 OK.

The example shows one timecard. Each timecard has an entry for all seven days, from Saturday to Friday.

{
"message": "Successfully fetched timesheet",
"data": {
"timesheetId": "tenant-123#user-a#20221231_20230106",
"tenantId": "tenant-123",
"userId": "tenant-123#user-a",
"userFullName": "User Full Name",
"periodStart": "2022-12-31",
"periodEnd": "2023-01-06",
"submittedAt": "2023-01-07T00:00:00.000Z",
"resubmissionAllowed": false,
"supplierId": "supplier-stu123vwx4567890",
"supplierName": "Supplier Name",
"userCustomFields": {},
"timeCards": [
{
"timesheetId": "tenant-123#user-a#20221231_20230106",
"userId": "tenant-123#user-a",
"projectId": "project-mno123pqr4567890",
"taskId": "task-pqr123stu4567890",
"status": "pending",
"data": {
"Saturday": {
"isoDate": "2022-12-31T00:00:00.000Z",
"hours": 0,
"description": null,
"review": null,
"reviewComment": null
},
"Sunday": {
"isoDate": "2023-01-01T00:00:00.000Z",
"hours": 0,
"description": null,
"review": null,
"reviewComment": null
},
"Monday": {
"isoDate": "2023-01-02T00:00:00.000Z",
"hours": 8,
"description": "Worked on implementation",
"review": null,
"reviewComment": null
},
"Tuesday": {
"isoDate": "2023-01-03T00:00:00.000Z",
"hours": 8,
"description": "Worked on implementation",
"review": null,
"reviewComment": null
},
"Wednesday": {
"isoDate": "2023-01-04T00:00:00.000Z",
"hours": 8,
"description": "Worked on implementation",
"review": null,
"reviewComment": null
},
"Thursday": {
"isoDate": "2023-01-05T00:00:00.000Z",
"hours": 8,
"description": "Worked on implementation",
"review": null,
"reviewComment": null
},
"Friday": {
"isoDate": "2023-01-06T00:00:00.000Z",
"hours": 8,
"description": "Worked on implementation",
"review": null,
"reviewComment": null
}
},
"projectName": "Project Name",
"projectBillingCategory": null,
"isDefault": false,
"taskName": "Task Name",
"taskBillingCategory": null,
"userFullName": "User Full Name",
"managerComments": null,
"reviewedAt": null,
"approverName": null,
"approverEmail": null,
"clientId": "client-ghi123jkl4567890",
"clientName": "Client Name",
"clientCustomFields": {},
"projectCustomFields": {}
}
]
}
}
FieldTypeDescription
userIdstringInternal user ID in the format <tenantId>#<userId>. List Timesheets returns the external ID instead.
submittedAtstring | nullSubmission time. null for a saved draft that was never submitted.
resubmissionAllowedbooleanWhether the user may submit this timesheet again.
supplierId, supplierNamestring | nullThe supplier the timesheet was submitted under, if any.
timeCards[].statusstringdraft, pending, approved, or rejected.
timeCards[].data.<Day>.isoDatestringThe day’s date as a full ISO 8601 timestamp.
timeCards[].data.<Day>.reviewboolean | nulltrue if the day was approved, false if rejected, null if not reviewed.
timeCards[].data.<Day>.reviewCommentstring | nullRejection reason for the day, if any.
timeCards[].managerCommentsstring | nullReviewer comments for the timecard.
timeCards[].reviewedAtstring | nullTime of the last review.
timeCards[].approverName, approverEmailstring | nullReviewer identity. Always null for reviews made through the API.
  • The endpoint returns saved drafts as well as submitted timesheets.
StatusMeaning
400The ID path segment was empty (for example, a trailing slash). Message: Timesheet ID not found.
404No timesheet has this ID. Message: Timesheet with ID <id> not found. This also happens if the # characters in the ID were not URL-encoded.
500Crewsum could not fetch the timesheet. Message: Error fetching timesheet.

Authentication and scope failures are described in Errors.

This endpoint does not trigger a webhook.