Timesheets

Authentication: All endpoints require an Authorization: Bearer <access token> header.

Most endpoints require an X-Company-ID: <company_id> header to scope requests to a specific company. This is the recommended header for most API operations.

Some endpoints require an X-Location-ID: <location_id> header when the query doesn't accept a locationId parameter.

See Authentication for details on how to obtain and use these headers.

Query Timesheets

GraphQL Query

query Timesheets($startTime: DateTime!, $endTime: DateTime!, $locationId: ID!) {
  timesheets(startTime: $startTime, endTime: $endTime, locationId: $locationId) {
    id
    startTime
    endTime
    status
    hours
    cost
    variance
    workType {
      id
      name
      appliedFromId
    }
    breaks {
      id
      startTime
      endTime
      subtracts
    }
    employee {
      id
      fullName
    }
    position {
      id
      text
    }
    location {
      id
      name
      timezone
    }
  }
}

Example Variables

{
  "startTime": "2024-04-01T16:00:00.000Z",
  "endTime": "2024-06-14T17:59:59.999Z",
  "locationId": "12325"
}

Example Response

{
  "data": {
    "timesheets": [
      {
        "id": "4518810",
        "startTime": "2024-04-04T23:00:00.000Z",
        "endTime": "2024-04-05T07:00:00.000Z",
        "status": "approved",
        "hours": 7.6,
        "cost": 0,
        "variance": 0,
        "workType": null,
        "breaks": [
          {
            "id": "330409",
            "startTime": "2024-04-05T02:00:00.000Z",
            "endTime": "2024-04-05T02:24:00.000Z",
            "subtracts": true
          }
        ],
        "employee": {
          "id": "73542",
          "fullName": "Kate Mallone"
        },
        "position": null,
        "location": {
          "id": "12326",
          "name": "Brisbane Office",
          "timezone": "Australia/Brisbane"
        }
      },
      {
        "id": "4518993",
        "startTime": "2024-06-09T23:00:00.000Z",
        "endTime": "2024-06-10T07:00:00.000Z",
        "status": "approved",
        "hours": 7.5,
        "cost": 0,
        "variance": 0,
        "workType": {
          "id": "114",
          "name": "Min Break",
          "appliedFromId": null
        },
        "breaks": [
          {
            "id": "330656",
            "startTime": "2024-06-10T03:00:00.000Z",
            "endTime": "2024-06-10T03:30:00.000Z",
            "subtracts": true
          }
        ],
        "employee": {
          "id": "72909",
          "fullName": "Nicolas Chan"
        },
        "position": {
          "id": "18100",
          "text": "Full Stack Developer"
        },
        "location": {
          "id": "12326",
          "name": "Brisbane Office",
          "timezone": "Australia/Brisbane"
        }
      }
    ]
  }
}