BlueSuite API
REST API v1

Timesheets & Time Entries

Manage timesheets and time entries via the REST API

This page covers both timesheets (read-only with status updates) and time entries (full CRUD). Timesheets are automatically created to group time entries by user and week. You cannot create or delete timesheets directly -- instead, manage individual time entries and update timesheet statuses.

Timesheets

List Timesheets

Returns a paginated list of timesheets.

GET /api/v1/timesheets

Required Scope: timesheets:read

Query Parameters:

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerResults per page, 1-100 (default: 25)
searchstringSearch timesheets by keyword
sort_bystringField to sort by
sort_directionstringasc or desc (default: desc)
start_datestringFilter by start date (YYYY-MM-DD)
end_datestringFilter by end date (YYYY-MM-DD)
user_idstringFilter by user UUID
statusstringFilter by status: draft, pending, approved, or rejected
curl "https://app.bluesuite.com/api/v1/timesheets?status=pending&user_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer wk_abc123.your_api_key"
{
  "success": true,
  "data": [
    {
      "id": 1,
      "user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "status": "pending",
      "start_date": "2025-03-10",
      "end_date": "2025-03-16",
      "total_time": 40.0
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total_pages": 1
  }
}

Get Timesheet

Returns a single timesheet with expanded details (time entries, user info, etc.).

GET /api/v1/timesheets/:id

Required Scope: timesheets:read

curl https://app.bluesuite.com/api/v1/timesheets/1 \
  -H "Authorization: Bearer wk_abc123.your_api_key"
{
  "success": true,
  "data": {
    "id": 1,
    "user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "pending",
    "start_date": "2025-03-10",
    "end_date": "2025-03-16",
    "total_time": 40.0,
    "time_entries": [
      {
        "id": 10,
        "start_date": "2025-03-10",
        "end_date": "2025-03-10",
        "start_time": "08:00",
        "end_time": "16:00",
        "total_time": 8.0,
        "description": "Window cleaning - 123 Main St"
      }
    ]
  }
}

Update Timesheet Status

Updates the status of a timesheet.

PUT /api/v1/timesheets/:id/status

Required Scope: timesheets:write

Request Body:

FieldTypeRequiredDescription
statusstringYesOne of: draft, pending, approved, rejected
curl -X PUT https://app.bluesuite.com/api/v1/timesheets/1/status \
  -H "Authorization: Bearer wk_abc123.your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "status": "approved" }'
{
  "success": true,
  "data": {
    "id": 1,
    "status": "approved"
  }
}

Time Entries

List Time Entries

Returns a paginated list of time entries.

GET /api/v1/time-entries

Required Scope: timesheets:read

Query Parameters:

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerResults per page, 1-100 (default: 25)
searchstringSearch time entries by keyword
sort_bystringField to sort by
sort_directionstringasc or desc (default: desc)
start_datestringFilter entries starting on or after this date (YYYY-MM-DD)
end_datestringFilter entries ending on or before this date (YYYY-MM-DD)
user_idstringFilter by user UUID
job_idintegerFilter by job ID
request_idintegerFilter by request ID
quote_idintegerFilter by quote ID
curl "https://app.bluesuite.com/api/v1/time-entries?start_date=2025-03-10&end_date=2025-03-16&job_id=10" \
  -H "Authorization: Bearer wk_abc123.your_api_key"
{
  "success": true,
  "data": [
    {
      "id": 10,
      "start_date": "2025-03-10",
      "end_date": "2025-03-10",
      "start_time": "08:00",
      "end_time": "16:00",
      "total_time": 8.0,
      "description": "Window cleaning - 123 Main St",
      "user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "job_id": 10
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total_pages": 1
  }
}

Create Time Entry

Creates a new time entry.

POST /api/v1/time-entries

Required Scope: timesheets:write

Request Body:

FieldTypeRequiredDescription
start_datestringYesStart date (YYYY-MM-DD)
end_datestringYesEnd date (YYYY-MM-DD)
start_timestringNoStart time (HH:MM, 24-hour format)
end_timestringNoEnd time (HH:MM, 24-hour format)
total_timenumberNoTotal hours worked (default: 0)
descriptionstringNoDescription of work performed
user_idstring (UUID)NoUser who performed the work (defaults to the API key creator)
job_idintegerNoAssociated job ID
request_idintegerNoAssociated request ID
quote_idintegerNoAssociated quote ID
curl -X POST https://app.bluesuite.com/api/v1/time-entries \
  -H "Authorization: Bearer wk_abc123.your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "start_date": "2025-03-12",
    "end_date": "2025-03-12",
    "start_time": "09:00",
    "end_time": "12:30",
    "total_time": 3.5,
    "description": "Gutter cleaning - 456 Oak Ave",
    "job_id": 10
  }'
{
  "success": true,
  "data": {
    "id": 15,
    "start_date": "2025-03-12",
    "end_date": "2025-03-12",
    "start_time": "09:00",
    "end_time": "12:30",
    "total_time": 3.5,
    "description": "Gutter cleaning - 456 Oak Ave",
    "job_id": 10,
    "user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "created_at": "2025-03-12T12:00:00.000Z"
  }
}

Update Time Entry

Updates an existing time entry. Only include the fields you want to change.

PUT /api/v1/time-entries/:id

Required Scope: timesheets:write

Request Body: Same fields as Create Time Entry. All fields are optional.

curl -X PUT https://app.bluesuite.com/api/v1/time-entries/15 \
  -H "Authorization: Bearer wk_abc123.your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "end_time": "13:00",
    "total_time": 4.0
  }'
{
  "success": true,
  "data": {
    "id": 15,
    "start_date": "2025-03-12",
    "end_date": "2025-03-12",
    "start_time": "09:00",
    "end_time": "13:00",
    "total_time": 4.0,
    "description": "Gutter cleaning - 456 Oak Ave",
    "job_id": 10
  }
}

Delete Time Entry

Deletes a time entry.

DELETE /api/v1/time-entries/:id

Required Scope: timesheets:write

curl -X DELETE https://app.bluesuite.com/api/v1/time-entries/15 \
  -H "Authorization: Bearer wk_abc123.your_api_key"
{
  "success": true,
  "data": {
    "deleted": true
  }
}

On this page