<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# List timesheets

`GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets`

Module: Timesheets · operationId: `listTimesheets` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequipay.com/#/api/list-timesheets

Returns the authenticated company's timesheets, paginated, newest period first. Soft-deleted timesheets are never returned. Line items are omitted from the list — fetch a single timesheet for its time entries.

Requires the `timesheets:read` scope.

## Query parameters

- `employee_id` (integer (int64)): Exact match on the employee id. Minimum: 1. Example: `1024`.
- `status` (string): Exact match on the timesheet status (e.g. draft, submitted). Example: `submitted`.
- `from` (string (date)): Only timesheets whose period starts on or after this date (YYYY-MM-DD). Example: `2024-01-01`.
- `to` (string (date)): Only timesheets whose period starts on or before this date (YYYY-MM-DD). Example: `2024-01-31`.
- `page` (integer): 1-based page number. Default: `1`. Minimum: 1.
- `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200.

## Example request

```bash
curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: A page of timesheets.

- `status` (integer) Example: `200`.
- `message` (string) Example: `success`.
- `data` (object)
  - `timesheets` (array of object)
    - `id` (integer (int64)) Example: `42`.
    - `employee_id` (integer (int64)) Example: `1024`.
    - `period_start` (string (date)) Example: `2024-01-01`.
    - `period_end` (string (date)) Example: `2024-01-14`.
    - `status` (string) Example: `submitted`.
    - `note` (string, nullable)
    - `submitted_at` (string (date-time), nullable) Example: `2024-01-15T12:00:00.000Z`.
    - `reviewed_at` (string (date-time), nullable)
    - `voided_at` (string (date-time), nullable)
    - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`.
    - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`.
    - `time_entries` (array of object): Present only on GET /v1/timesheets/{id}.
      - `id` (integer (int64)) Example: `5001`.
      - `timesheet_id` (integer (int64)) Example: `42`.
      - `employee_id` (integer (int64)) Example: `1024`.
      - `work_date` (string (date)) Example: `2024-01-02`.
      - `started_at` (string (date-time), nullable) Example: `2024-01-02T16:00:00.000Z`.
      - `ended_at` (string (date-time), nullable) Example: `2024-01-02T20:00:00.000Z`.
      - `minutes` (integer) Example: `240`.
      - `break_minutes` (integer) Example: `0`.
      - `kind` (string) Example: `worked`.
      - `source` (string) Example: `manual`.
      - `job_ref` (string, nullable) Example: `J-1001`.
      - `job_label` (string, nullable) Example: `Install`.
      - `note` (string, nullable)
      - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`.
      - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`.
  - `current_page` (integer) Example: `1`.
  - `per_page` (integer) Example: `20`.
  - `total` (integer) Example: `8`.
  - `last_page` (integer) Example: `1`.
  - `filters` (object): Echoes the filters actually applied.

### 401: Missing, invalid, expired, or revoked token (from the authorizer).

### 403: The token lacks the required scope.

```json
{
  "error": "insufficient_scope",
  "required": "users:read"
}
```

### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result.

```json
{
  "status": 500,
  "message": "internal error",
  "data": null
}
```
