> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guardhousehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a timesheet entry

> Returns the full detail for a single timesheet entry by ID. The entry must belong to your API key's company, customers, and sites. Requires an API key with `KeyType=timesheet`.



## OpenAPI

````yaml /api-reference/openapi.json get /api/external/timesheets/{id}
openapi: 3.1.0
info:
  title: Guardhouse API
  version: 1.0.0
  description: >-
    The Guardhouse API gives external systems programmatic access to incident
    reports, timesheets, staff, customers, sites, and webhook event
    subscriptions.


    All endpoints return a consistent envelope (`ApiResponse`,
    `ApiPagedResponse`, or `ApiPostPagedResponse`). Authentication is a two-step
    flow: exchange a long-lived **API key** for a short-lived **JWT bearer
    token**, then send the bearer on every subsequent request.
  contact:
    name: Guardhouse Support
  license:
    name: Proprietary
servers:
  - url: https://gateway-api.guardhousehq.com
    description: AU production
  - url: https://gateway-api.guardhousehq.co.uk
    description: UK production
security:
  - bearerAuth: []
    subscriptionKey: []
tags:
  - name: Authentication
    description: >-
      Exchange a long-lived API key for a short-lived JWT bearer token. The
      token must be sent as `Authorization: Bearer <token>` on every subsequent
      request.
  - name: Incident Reports
    description: >-
      List, fetch, and export incident reports submitted against your customers
      and sites. Requires an API key with `KeyType=incidentreport`.
  - name: Timesheets
    description: List timesheet entries and fetch per-entry rate breakdowns.
  - name: Live Operations
    description: >-
      Retrieve live shift and employee operational data, including clock-in
      status, location, welfare checks, and license details.
  - name: Staff
    description: >-
      List, create, and update employees and their security licenses. Read
      endpoints (`GET /api/external/staffs`, `GET
      /api/external/staffs/{id}/licenses`) are accessible with any valid Public
      API key. Write endpoints (`POST`, `PATCH`, `GET /staffs/search`) require
      `KeyType=developer`.
  - name: Customers
    description: List customer records visible to your API key.
  - name: Sites
    description: List sites visible to your API key.
  - name: Webhooks
    description: >-
      Manage webhook subscribers and event subscriptions so Guardhouse can
      notify your systems when incident reports or timesheets change. Requires
      an API key with `KeyType=developer`.
  - name: Login Audit
    description: >-
      Read-only access to login activity (successful logins, failed logins, and
      reserved logout events) for your company. **Requires an API key issued
      with the `login-audits.read` entitlement scope** — keys without this
      special scope are rejected at the auth layer with `403 Forbidden`. Tokens
      minted from such a key carry `login-audits.read` in their `Scope` claim,
      which is what the endpoint checks.
paths:
  /api/external/timesheets/{id}:
    get:
      tags:
        - Timesheets
      summary: Get a timesheet entry
      description: >-
        Returns the full detail for a single timesheet entry by ID. The entry
        must belong to your API key's company, customers, and sites. Requires an
        API key with `KeyType=timesheet`.
      parameters:
        - name: id
          in: path
          required: true
          description: Timesheet entry ID.
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Timesheet entry detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimesheetEntryEnvelope'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    TimesheetEntryEnvelope:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/TimesheetEntry'
    ApiResponse:
      type: object
      description: The standard envelope for every JSON endpoint.
      properties:
        status:
          $ref: '#/components/schemas/Status'
        data:
          description: Endpoint-specific payload. `null` when an error occurred.
          nullable: true
        count:
          type: integer
          format: int32
          nullable: true
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    TimesheetEntry:
      type: object
      description: >-
        Public-facing view of a timesheet entry. Nested arrays (`allowances`,
        `notes`, `staffSubmittedTimesheetTimes`, `scheduleNotes`) carry detail
        objects whose schema is best inspected from a sample response — they're
        typed as generic objects here.
      properties:
        timesheetId:
          type: integer
          format: int32
        customerName:
          type: string
        customerApiId:
          type: integer
          format: int32
          nullable: true
        siteName:
          type: string
        siteApiId:
          type: integer
          format: int32
          nullable: true
        staffId:
          type: string
          description: Employee.Id as a string.
        staffName:
          type: string
        employeeId:
          type: string
          description: Employee.ExternalReferenceNumber.
        employeeReferenceNumber:
          type: string
        email:
          type: string
          format: email
        mobile:
          type: string
        subcontractorCompany:
          type: string
        entryType:
          type: string
        position:
          type: string
        service:
          type: string
        paygroup:
          type: string
        scheduledStartTime:
          type: string
          format: date-time
          nullable: true
        scheduledEndTime:
          type: string
          format: date-time
          nullable: true
        timeclockStartTime:
          type: string
          format: date-time
          nullable: true
        clockInCoordinates:
          type: object
          additionalProperties: true
          nullable: true
        timeclockBreakStartTime:
          type: string
          format: date-time
          nullable: true
        timeclockBreakEndTime:
          type: string
          format: date-time
          nullable: true
        timeclockEndTime:
          type: string
          format: date-time
          nullable: true
        clockOutCoordinates:
          type: object
          additionalProperties: true
          nullable: true
        staffSubmittedTimesheetTimes:
          type: array
          items:
            type: object
            additionalProperties: true
        payStartTime:
          type: string
          format: date-time
        payEndTime:
          type: string
          format: date-time
        payBreakTime:
          type: integer
          format: int32
          nullable: true
        invoiceStartTime:
          type: string
          format: date-time
        invoiceEndTime:
          type: string
          format: date-time
        invoiceBreakTime:
          type: integer
          format: int32
          nullable: true
        notes:
          type: array
          items:
            type: object
            additionalProperties: true
        allowances:
          type: array
          items:
            type: object
            additionalProperties: true
        status:
          type: string
          enum:
            - Approved
            - Rejected
            - Unapproved
        approvedBy:
          type: string
        approvedDateTime:
          type: string
          format: date-time
          nullable: true
        customerApprovalStatus:
          type: string
        customerApprover:
          type: string
        customerApprovedDateTime:
          type: string
          format: date-time
          nullable: true
        lock:
          type: boolean
        scheduleNotes:
          type: object
          additionalProperties: true
          nullable: true
    Status:
      type: object
      properties:
        code:
          type: integer
          format: int32
          description: Numeric service result code. `0` indicates success.
        errorMessage:
          type: string
          description: Human-readable error message; empty on success.
    Error:
      type: object
      properties:
        code:
          type: integer
          format: int32
          default: 100
        message:
          type: string
  responses:
    Forbidden:
      description: >-
        The bearer token is missing the required policy or `KeyType` claim, or
        the resource is outside your API key's scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResponse'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT issued by `POST /api/external/token/request`. Send as
        `Authorization: Bearer <token>`.
    subscriptionKey:
      type: apiKey
      in: header
      name: external-gh-apim-sub-key
      description: >-
        Guardhouse API Management subscription key. Required on every request.
        The same value is used by all API consumers within a region — contact
        Guardhouse Support for the subscription key.

````