{
 "openapi": "3.1.0",
 "info": {
  "title": "Teamward API",
  "version": "v1",
  "description": "Teamward's REST API lets your own systems read and update your Teamward account: staff, the time clock and\ntimesheets, time off, chat, the company feed, the knowledge base and HR records. Webhooks push events (a clock-in,\na time off request, a new hire) to your system the moment they happen.\n\nIt is modelled on Connecteam's API, so if you have an integration for Connecteam most of it carries over: the same\n`X-API-KEY` header, the same `/area/v1/...` paths, `limit`/`offset` paging, a `{requestId, data, paging}` response\nenvelope, Unix-second timestamps, `x-ratelimit-*` headers and webhooks with an `x-webhook-secret` header.\n\n## Getting started\n\n1. In Teamward, an **admin** opens **Office Admin → API & webhooks → Create key**, names it after the system it's\n   for, and ticks the permissions it needs. The key (`tw_live_…`) is shown once. Copy it somewhere safe.\n2. Call the API with the key in the `X-API-KEY` header:\n\n```bash\ncurl https://api.teamward.app/me -H \"X-API-KEY: tw_live_your_key_here\"\n```\n\nBase URL: `https://api.teamward.app`. Until that address is live for you, the same API answers at `https://vecnqjyejqxluxookmnb.supabase.co/functions/v1/api`.\n\n## How keys work\n\n- A key belongs to one company and acts **on behalf of the admin who created it**. Everything it does follows that\n  admin's access rules and shows up in Teamward as done by them (or, for punches, by the employee being punched).\n- A key only reaches the areas you ticked (its *scopes*). Calling something outside them returns `403`.\n- A key stops working if it's revoked, if the admin who made it is removed or is no longer an admin, or if the\n  Teamward account is locked for billing.\n- Make one key per connected system so you can revoke one without breaking the others. Keys are stored scrambled\n  (hashed); Teamward can't show a key again after it's created.\n\n| Scope | Gives |\n| --- | --- |\n| `users.read` / `users.write` | Staff, roles, branches / add, change, archive and restore staff |\n| `time_clock.read` / `time_clock.write` | Shifts, punches, requests, timesheet totals / clock in/out, breaks, add/edit/delete shifts, review requests |\n| `time_off.read` / `time_off.write` | Requests, types, balances, holidays / book, approve, deny, cancel |\n| `chat.read` / `chat.write` | The key owner's conversations and messages / send messages as the key owner |\n| `feed.read` / `feed.write` | Company feed posts / publish posts |\n| `kb.read` | Published knowledge base articles |\n| `hr.read` | HR records: pay rate, hire date, birthday, address, emergency contact, licences. Also adds pay rate and estimated gross pay to timesheet totals |\n| `webhooks.read` / `webhooks.write` | List / create, change, test and delete webhooks |\n\n## Requests and responses\n\n- JSON in and out. Send `Content-Type: application/json` with a body.\n- IDs are UUID strings (Connecteam uses integers, so store them as text).\n- Timestamps are **Unix seconds**. Dates are `YYYY-MM-DD` and times `HH:MM` (24-hour), in the company's time zone\n  (`GET /me` returns it).\n- Every response has a `requestId`. Successful ones put the result in `data`:\n\n```json\n{ \"requestId\": \"3f0c…\", \"data\": { \"users\": [ … ] }, \"paging\": { \"offset\": 10, \"total\": 37 } }\n```\n\n## Paging\n\nList endpoints take `limit` (1–500, default 10) and `offset` (default 0). `paging.offset` is the offset to ask for\nnext and `paging.total` the number of matches. Stop when a page has fewer items than `limit`:\n\n```python\noffset, users = 0, []\nwhile True:\n    r = requests.get(f\"https://api.teamward.app/users/v1/users\", params={\"limit\": 500, \"offset\": offset},\n                     headers={\"X-API-KEY\": KEY}).json()\n    users += r[\"data\"][\"users\"]\n    if len(r[\"data\"][\"users\"]) < 500: break\n    offset = r[\"paging\"][\"offset\"]\n```\n\n## Rate limits\n\n100 requests a minute and 10,000 a day **per company** (shared by all its keys). Every response carries\n`x-ratelimit-minute-limit`, `x-ratelimit-minute-remaining`, `x-ratelimit-minute-reset`, `x-ratelimit-day-limit`,\n`x-ratelimit-day-remaining` and `x-ratelimit-day-reset` (reset = Unix seconds). Over the limit you get `429` with a\n`Retry-After` header. Back off and retry.\n\n## Errors\n\nErrors carry a `detail`. Validation errors (`422`) list each problem, like Connecteam:\n\n```json\n{ \"requestId\": \"…\", \"detail\": [{ \"loc\": [\"query\", \"startDate\"], \"msg\": \"Use YYYY-MM-DD\", \"type\": \"value_error\" }] }\n```\n\n| Status | Meaning |\n| --- | --- |\n| 400 | Teamward refused the change (the message says why, e.g. \"This request was already reviewed\") |\n| 401 | Missing, wrong or revoked key, or its admin was removed |\n| 403 | The key lacks the scope, the key owner isn't allowed, or the account is locked |\n| 404 | Not found (or not visible to the key owner) |\n| 409 | Conflicts with existing data (overlapping shift, already clocked in, email already used) |\n| 422 | Invalid input |\n| 429 | Rate limit, see above |\n| 500 | Our fault. Retry later and quote the `requestId` if it keeps happening |\n\n## The time clock\n\nEach company has one time clock. Its ID is your company ID (from `GET /me`), and the word `default` works\neverywhere a `timeClockId` is expected. A shift (`timeActivity`) has a `start` and `end` time point (`timestamp`,\n`timezone`, optional `locationData`), `breakMinutes`, `workedMinutes` and `isOpen` while the person is still clocked in.\nTeamward records breaks as total minutes on the shift, so `manualBreaks` is always empty.\n\n`GET …/timesheet` returns pay-period totals calculated exactly like Teamward's payroll page: regular and overtime hours\nper Monday–Sunday week (your overtime rules), public holiday pay, holiday premium hours and paid/unpaid time off.\n\n## Webhooks\n\nCreate webhooks in **Office Admin → API & webhooks**, or with `POST /settings/v1/webhooks`. Teamward sends a `POST`\nwith a JSON body to your HTTPS URL for each event you subscribed to (or `[\"*\"]` for all).\n\n- Headers: `x-webhook-secret` (the webhook's secret, shown once when it's created. Compare it to make sure the\n  call came from Teamward), `x-teamward-event` and `x-teamward-delivery` (a delivery ID).\n- Reply with any `2xx` within **10 seconds**, then do the slow work afterwards.\n- Failed deliveries are retried up to 3 more times (after about 1, 4 and 9 minutes). `404` is treated as permanent.\n  A webhook that fails 50 times in a row is switched off; turn it back on in Teamward.\n- Retries resend the same body. Deduplicate on `x-teamward-delivery`, or on `eventType` plus the entity ID.\n\nEvery payload has `requestId`, `company`, `eventType`, `eventTimestamp`, `activityType` and `webhookVersion` (1).\nTime clock events are flat like Connecteam's (`userId`, `timeClockId`, `timeActivityId`, `timeActivity`, `actorId`).\nThe others put the record in `data`.\n\n```json\n{ \"requestId\": \"…\", \"company\": \"<companyId>\", \"eventType\": \"clock_in\", \"eventTimestamp\": 1793700000,\n  \"activityType\": \"shift\", \"webhookVersion\": 1, \"userId\": \"…\", \"timeClockId\": \"<companyId>\",\n  \"timeActivityId\": \"…\", \"actorId\": \"…\",\n  \"timeActivity\": { \"id\": \"…\", \"userId\": \"…\", \"start\": { \"timestamp\": 1793700000, \"timezone\": \"America/Toronto\" },\n                    \"breakMinutes\": 0, \"workedMinutes\": 0, \"isOpen\": true } }\n```\n\n| Area | activityType | eventType |\n| --- | --- | --- |\n| Staff | `User` | `user_created`, `user_updated`, `user_archived`, `user_restored` (data = array of users) |\n| Time clock | `shift` | `clock_in`, `clock_out`, `break_start`, `break_end`, `admin_add`, `admin_edit`, `admin_delete`, `user_add_request`, `user_edit_request`, `user_delete_request`, `admin_approved_add_request`, `admin_approved_edit_request`, `admin_approved_delete_request`, `admin_declined_request` |\n| Time off | `time_off` | `time_off_requested`, `time_off_booked`, `time_off_approved`, `time_off_denied`, `time_off_cancelled` |\n| Chat | `chat` | `message_created`, `message_updated`, `message_deleted` |\n| Feed | `feed` | `post_published` |\n| Test | `webhook` | `ping` (from the Test button or `POST /settings/v1/webhooks/{id}/test`) |\n\n## Coming from Connecteam\n\n| Connecteam | Teamward |\n| --- | --- |\n| `GET /me` | `GET /me` (adds `timezone` and the key's scopes) |\n| `GET /users/v1/users` | same, plus `branchIds`/`roleIds` filters |\n| `POST /users/v1/users` (array) | same (people get an email invite to set their password) |\n| Smart groups | Roles (`/users/v1/roles`) and branches (`/users/v1/branches`) |\n| `GET /time-clock/v1/time-clocks` | same (one clock per company) |\n| `GET /time-clock/v1/time-clocks/{id}/time-activities` | same shape: `timeActivitiesByUsers[].shifts/manualBreaks/timeOffs` |\n| Clock in / out | `POST …/clock-in`, `…/clock-out`, `…/break-start`, `…/break-end` |\n| `GET /time-off/v1/requests`, policy types, balances | same paths |\n| `GET /chat/v1/conversations`, `POST …/{id}/message` | same (as the key owner) |\n| Webhooks (`/settings/v1/webhooks`, `x-webhook-secret`) | same |\n| Job scheduling, tasks, forms, jobs | Not in Teamward yet |",
  "contact": {
   "name": "Teamward",
   "email": "hello@teamward.app",
   "url": "https://teamward.app/developers"
  }
 },
 "servers": [
  {
   "url": "https://api.teamward.app",
   "description": "Production"
  },
  {
   "url": "https://vecnqjyejqxluxookmnb.supabase.co/functions/v1/api",
   "description": "Direct (same API)"
  }
 ],
 "security": [
  {
   "ApiKey": []
  }
 ],
 "tags": [
  {
   "name": "Account"
  },
  {
   "name": "Users"
  },
  {
   "name": "Time clock"
  },
  {
   "name": "Time off"
  },
  {
   "name": "Chat"
  },
  {
   "name": "Feed"
  },
  {
   "name": "Knowledge base"
  },
  {
   "name": "HR"
  },
  {
   "name": "Webhooks"
  }
 ],
 "paths": {
  "/me": {
   "get": {
    "tags": [
     "Account"
    ],
    "summary": "Get account information",
    "operationId": "get_me",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "companyId": {
             "type": "string",
             "format": "uuid"
            },
            "companyName": {
             "type": "string"
            },
            "timezone": {
             "type": "string"
            },
            "apiKey": {
             "type": "object",
             "properties": {
              "id": {
               "type": "string",
               "format": "uuid"
              },
              "name": {
               "type": "string"
              },
              "scopes": {
               "type": "array",
               "items": {
                "type": "string"
               }
              },
              "ownerUserId": {
               "type": "string",
               "format": "uuid"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Your company, its time zone and what this key can do. A good first call to check a key.\n\nAny key"
   }
  },
  "/users/v1/users": {
   "get": {
    "tags": [
     "Users"
    ],
    "summary": "Get users",
    "operationId": "get_users_v1_users",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     },
     {
      "name": "userStatus",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "all"
       ],
       "default": "active"
      }
     },
     {
      "name": "emailAddresses",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string"
       }
      }
     },
     {
      "name": "fullNames",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "description": "Exact, case-insensitive"
     },
     {
      "name": "phoneNumbers",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string"
       }
      }
     },
     {
      "name": "branchIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      }
     },
     {
      "name": "roleIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      }
     },
     {
      "name": "createdAt",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Unix seconds"
      },
      "description": "Created after"
     },
     {
      "name": "modifiedAt",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Unix seconds"
      },
      "description": "Changed after (use for incremental sync)"
     },
     {
      "name": "lastLogin",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Unix seconds"
      },
      "description": "Active in the app after"
     },
     {
      "name": "sort",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "created_at",
        "name"
       ],
       "default": "created_at"
      }
     },
     {
      "name": "order",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "asc",
        "desc"
       ],
       "default": "asc"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "users": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/User"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `users.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.read"
   },
   "post": {
    "tags": [
     "Users"
    ],
    "summary": "Create users",
    "operationId": "post_users_v1_users",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "users": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/User"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Adds 1–50 people to your company. Each gets an email invite to choose a password. People with no `roleId` get your default technician role. `409` if an email already has a Teamward login.\n\nScope: `users.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "oneOf": [
         {
          "type": "array",
          "items": {
           "$ref": "#/components/schemas/UserInput"
          }
         },
         {
          "$ref": "#/components/schemas/UserInput"
         }
        ]
       }
      }
     }
    }
   }
  },
  "/users/v1/users/{userId}": {
   "get": {
    "tags": [
     "Users"
    ],
    "summary": "Get a user",
    "operationId": "get_users_v1_users_userId",
    "parameters": [
     {
      "name": "userId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "user": {
             "$ref": "#/components/schemas/User"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `users.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.read"
   },
   "put": {
    "tags": [
     "Users"
    ],
    "summary": "Update a user",
    "operationId": "put_users_v1_users_userId",
    "parameters": [
     {
      "name": "userId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "user": {
             "$ref": "#/components/schemas/User"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Only the fields you send change. Email can't be changed here (people change it themselves).\n\nScope: `users.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UserUpdate"
       }
      }
     }
    }
   }
  },
  "/users/v1/users/archive": {
   "post": {
    "tags": [
     "Users"
    ],
    "summary": "Archive users",
    "operationId": "post_users_v1_users_archive",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "users": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/User"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Turns off sign-in for these people (the same as switching off *Can sign in*). Their history stays.\n\nScope: `users.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "userIds"
        ],
        "properties": {
         "userIds": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "uuid"
          },
          "maxItems": 200
         }
        }
       }
      }
     }
    }
   }
  },
  "/users/v1/users/restore": {
   "post": {
    "tags": [
     "Users"
    ],
    "summary": "Restore users",
    "operationId": "post_users_v1_users_restore",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "users": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/User"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `users.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "userIds"
        ],
        "properties": {
         "userIds": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "uuid"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/users/v1/roles": {
   "get": {
    "tags": [
     "Users"
    ],
    "summary": "Get roles",
    "operationId": "get_users_v1_roles",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "roles": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Role"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `users.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.read"
   }
  },
  "/users/v1/branches": {
   "get": {
    "tags": [
     "Users"
    ],
    "summary": "Get branches",
    "operationId": "get_users_v1_branches",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "branches": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Branch"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `users.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "users.read"
   }
  },
  "/time-clock/v1/time-clocks": {
   "get": {
    "tags": [
     "Time clock"
    ],
    "summary": "Get time clocks",
    "operationId": "get_time_clock_v1_time_clocks",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "timeClocks": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "name": {
                "type": "string"
               },
               "timezone": {
                "type": "string"
               },
               "isArchived": {
                "type": "boolean"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_clock.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.read"
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/time-activities": {
   "get": {
    "tags": [
     "Time clock"
    ],
    "summary": "Get time activities",
    "operationId": "get_time_clock_v1_time_clocks_timeClockId_time_activities",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "startDate",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     },
     {
      "name": "endDate",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "timeActivitiesByUsers": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "userId": {
                "type": "string",
                "format": "uuid"
               },
               "shifts": {
                "type": "array",
                "items": {
                 "$ref": "#/components/schemas/Shift"
                }
               },
               "manualBreaks": {
                "type": "array",
                "maxItems": 0
               },
               "timeOffs": {
                "type": "array",
                "items": {
                 "$ref": "#/components/schemas/TimeOffRequest"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Shifts that started in the date range (company time zone, up to 366 days) and approved time off overlapping it, grouped by person. `/time-clock/v1/time-activities` is a shortcut for the default clock.\n\nScope: `time_clock.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.read"
   },
   "post": {
    "tags": [
     "Time clock"
    ],
    "summary": "Add shifts",
    "operationId": "post_time_clock_v1_time_clocks_timeClockId_time_activities",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     }
    ],
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "shifts": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Shift"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Adds finished shifts, the same as a manager adding one in the app. They're marked manual and logged in the punch log. Shifts can't overlap, be in the future or be longer than 24 hours.\n\nScope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/ShiftInput"
         },
         {
          "type": "object",
          "properties": {
           "shifts": {
            "type": "array",
            "items": {
             "$ref": "#/components/schemas/ShiftInput"
            },
            "maxItems": 100
           }
          }
         }
        ]
       }
      }
     }
    }
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/time-activities/{activityId}": {
   "put": {
    "tags": [
     "Time clock"
    ],
    "summary": "Edit a shift",
    "operationId": "put_time_clock_v1_time_clocks_timeClockId_time_activities_activityId",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "activityId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "shift": {
             "$ref": "#/components/schemas/Shift"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ShiftUpdate"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Time clock"
    ],
    "summary": "Delete a shift",
    "operationId": "delete_time_clock_v1_time_clocks_timeClockId_time_activities_activityId",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "activityId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "deletedId": {
             "type": "string",
             "format": "uuid"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write"
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/clock-in": {
   "post": {
    "tags": [
     "Time clock"
    ],
    "summary": "Clock in",
    "operationId": "post_time_clock_v1_time_clocks_timeClockId_clock_in",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "shift": {
             "$ref": "#/components/schemas/Shift"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Punches for an employee, e.g. from a kiosk or another system. Recorded as the employee's own punch. `409` if they're already in that state.\n\nScope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Punch"
       }
      }
     }
    }
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/clock-out": {
   "post": {
    "tags": [
     "Time clock"
    ],
    "summary": "Clock out",
    "operationId": "post_time_clock_v1_time_clocks_timeClockId_clock_out",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "shift": {
             "$ref": "#/components/schemas/Shift"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Punches for an employee, e.g. from a kiosk or another system. Recorded as the employee's own punch. `409` if they're already in that state.\n\nScope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Punch"
       }
      }
     }
    }
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/break-start": {
   "post": {
    "tags": [
     "Time clock"
    ],
    "summary": "Start a break",
    "operationId": "post_time_clock_v1_time_clocks_timeClockId_break_start",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "shift": {
             "$ref": "#/components/schemas/Shift"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Punches for an employee, e.g. from a kiosk or another system. Recorded as the employee's own punch. `409` if they're already in that state.\n\nScope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Punch"
       }
      }
     }
    }
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/break-end": {
   "post": {
    "tags": [
     "Time clock"
    ],
    "summary": "End a break",
    "operationId": "post_time_clock_v1_time_clocks_timeClockId_break_end",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "shift": {
             "$ref": "#/components/schemas/Shift"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Punches for an employee, e.g. from a kiosk or another system. Recorded as the employee's own punch. `409` if they're already in that state.\n\nScope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Punch"
       }
      }
     }
    }
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/on-the-clock": {
   "get": {
    "tags": [
     "Time clock"
    ],
    "summary": "Who's clocked in",
    "operationId": "get_time_clock_v1_time_clocks_timeClockId_on_the_clock",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "shifts": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Shift"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_clock.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.read"
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/punches": {
   "get": {
    "tags": [
     "Time clock"
    ],
    "summary": "Get the punch log",
    "operationId": "get_time_clock_v1_time_clocks_timeClockId_punches",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "startDate",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     },
     {
      "name": "endDate",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "punches": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string",
                "format": "uuid"
               },
               "userId": {
                "type": "string",
                "format": "uuid"
               },
               "timeActivityId": {
                "type": "string",
                "format": "uuid"
               },
               "type": {
                "type": "string",
                "enum": [
                 "clock_in",
                 "clock_out",
                 "break_start",
                 "break_end",
                 "admin_add",
                 "admin_edit",
                 "admin_delete"
                ]
               },
               "timestamp": {
                "type": "integer",
                "description": "Unix seconds"
               },
               "locationData": {
                "type": "object"
               },
               "actorId": {
                "type": "string",
                "format": "uuid"
               }
              }
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Every punch and edit, with who made it.\n\nScope: `time_clock.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.read"
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/requests": {
   "get": {
    "tags": [
     "Time clock"
    ],
    "summary": "Get shift change requests",
    "operationId": "get_time_clock_v1_time_clocks_timeClockId_requests",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     },
     {
      "name": "statuses",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "enum": [
         "pending",
         "approved",
         "denied"
        ]
       }
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "requests": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string",
                "format": "uuid"
               },
               "userId": {
                "type": "string",
                "format": "uuid"
               },
               "timeActivityId": {
                "type": "string",
                "format": "uuid"
               },
               "action": {
                "type": "string",
                "enum": [
                 "add",
                 "edit",
                 "delete"
                ]
               },
               "status": {
                "type": "string",
                "enum": [
                 "pending",
                 "approved",
                 "denied"
                ]
               },
               "start": {
                "type": "integer",
                "description": "Unix seconds"
               },
               "end": {
                "type": "integer",
                "description": "Unix seconds"
               },
               "breakMinutes": {
                "type": "integer"
               },
               "reason": {
                "type": "string"
               },
               "reviewedBy": {
                "type": "string",
                "format": "uuid"
               },
               "reviewNote": {
                "type": "string"
               },
               "createdAt": {
                "type": "integer",
                "description": "Unix seconds"
               }
              }
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Employees' requests to add, change or delete a shift.\n\nScope: `time_clock.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.read"
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/requests/{requestId}/approve": {
   "post": {
    "tags": [
     "Time clock"
    ],
    "summary": "Approve a shift request",
    "operationId": "post_time_clock_v1_time_clocks_timeClockId_requests_requestId_approve",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "format": "uuid"
            },
            "status": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "managerNote": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/requests/{requestId}/decline": {
   "post": {
    "tags": [
     "Time clock"
    ],
    "summary": "Decline a shift request",
    "operationId": "post_time_clock_v1_time_clocks_timeClockId_requests_requestId_decline",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "format": "uuid"
            },
            "status": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_clock.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.write",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "managerNote": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/time-clock/v1/time-clocks/{timeClockId}/timesheet": {
   "get": {
    "tags": [
     "Time clock"
    ],
    "summary": "Get timesheet totals",
    "operationId": "get_time_clock_v1_time_clocks_timeClockId_timesheet",
    "parameters": [
     {
      "name": "timeClockId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your company ID, or `default`"
     },
     {
      "name": "startDate",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     },
     {
      "name": "endDate",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "startDate": {
             "type": "string",
             "format": "date",
             "example": "2026-11-02"
            },
            "endDate": {
             "type": "string",
             "format": "date",
             "example": "2026-11-02"
            },
            "timezone": {
             "type": "string"
            },
            "rules": {
             "type": "object",
             "description": "The company's payroll rules (Office Admin → Payroll rules)"
            },
            "users": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "userId": {
                "type": "string",
                "format": "uuid"
               },
               "fullName": {
                "type": "string"
               },
               "workedHours": {
                "type": "number"
               },
               "regularHours": {
                "type": "number"
               },
               "overtimeHours": {
                "type": "number"
               },
               "holidayPayHours": {
                "type": "number"
               },
               "holidayPremiumHours": {
                "type": "number"
               },
               "paidTimeOffHours": {
                "type": "object",
                "additionalProperties": {
                 "type": "number"
                }
               },
               "unpaidTimeOffHours": {
                "type": "number"
               },
               "daysWorked": {
                "type": "integer"
               },
               "isClockedIn": {
                "type": "boolean"
               },
               "weeks": {
                "type": "array",
                "items": {
                 "type": "object"
                }
               },
               "holidays": {
                "type": "array",
                "items": {
                 "type": "object"
                }
               },
               "substituteDaysOff": {
                "type": "array",
                "items": {
                 "type": "object"
                }
               },
               "flags": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "payRate": {
                "type": "number",
                "description": "Only with hr.read"
               },
               "estimatedGross": {
                "type": "number",
                "description": "Only with hr.read"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Pay-period totals, the same as Teamward's payroll page. The range is widened to whole Monday–Sunday weeks (up to 9 weeks). Overtime, public holiday pay and premium follow your payroll rules.\n\nScope: `time_clock.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_clock.read"
   }
  },
  "/time-off/v1/policy-types": {
   "get": {
    "tags": [
     "Time off"
    ],
    "summary": "Get time off types",
    "operationId": "get_time_off_v1_policy_types",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "policyTypes": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/PolicyType"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.read"
   }
  },
  "/time-off/v1/requests": {
   "get": {
    "tags": [
     "Time off"
    ],
    "summary": "Get time off requests",
    "operationId": "get_time_off_v1_requests",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     },
     {
      "name": "startDate",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      },
      "description": "Overlapping from"
     },
     {
      "name": "endDate",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     },
     {
      "name": "statuses",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "enum": [
         "pending",
         "approved",
         "denied",
         "cancelled"
        ]
       }
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "requests": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/TimeOffRequest"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.read"
   },
   "post": {
    "tags": [
     "Time off"
    ],
    "summary": "Book time off",
    "operationId": "post_time_off_v1_requests",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "request": {
             "$ref": "#/components/schemas/TimeOffRequest"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Books time off for someone, approved straight away (like a manager booking it). The person is notified.\n\nScope: `time_off.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TimeOffInput"
       }
      }
     }
    }
   }
  },
  "/time-off/v1/requests/{requestId}": {
   "get": {
    "tags": [
     "Time off"
    ],
    "summary": "Get a time off request",
    "operationId": "get_time_off_v1_requests_requestId",
    "parameters": [
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "request": {
             "$ref": "#/components/schemas/TimeOffRequest"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.read"
   }
  },
  "/time-off/v1/requests/{requestId}/approve": {
   "post": {
    "tags": [
     "Time off"
    ],
    "summary": "Approve a pending request",
    "operationId": "post_time_off_v1_requests_requestId_approve",
    "parameters": [
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "request": {
             "$ref": "#/components/schemas/TimeOffRequest"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.write",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "managerNote": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/time-off/v1/requests/{requestId}/deny": {
   "post": {
    "tags": [
     "Time off"
    ],
    "summary": "Deny a pending request",
    "operationId": "post_time_off_v1_requests_requestId_deny",
    "parameters": [
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "request": {
             "$ref": "#/components/schemas/TimeOffRequest"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.write",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "managerNote": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/time-off/v1/requests/{requestId}/cancel": {
   "post": {
    "tags": [
     "Time off"
    ],
    "summary": "Cancel a request",
    "operationId": "post_time_off_v1_requests_requestId_cancel",
    "parameters": [
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "request": {
             "$ref": "#/components/schemas/TimeOffRequest"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.write",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "managerNote": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/time-off/v1/balances": {
   "get": {
    "tags": [
     "Time off"
    ],
    "summary": "Get balances",
    "operationId": "get_time_off_v1_balances",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "balances": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Balance"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.read"
   }
  },
  "/time-off/v1/holidays": {
   "get": {
    "tags": [
     "Time off"
    ],
    "summary": "Get public holidays",
    "operationId": "get_time_off_v1_holidays",
    "parameters": [
     {
      "name": "year",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "Defaults to this year"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "holidays": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string",
                "format": "uuid"
               },
               "date": {
                "type": "string",
                "format": "date",
                "example": "2026-11-02"
               },
               "name": {
                "type": "string"
               },
               "isStatutory": {
                "type": "boolean"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `time_off.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "time_off.read"
   }
  },
  "/chat/v1/conversations": {
   "get": {
    "tags": [
     "Chat"
    ],
    "summary": "Get conversations",
    "operationId": "get_chat_v1_conversations",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "conversations": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Conversation"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The conversations the key owner is in. Chat is private, so the API can't see chats the key owner isn't part of.\n\nScope: `chat.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "chat.read"
   }
  },
  "/chat/v1/conversations/{conversationId}/messages": {
   "get": {
    "tags": [
     "Chat"
    ],
    "summary": "Get messages",
    "operationId": "get_chat_v1_conversations_conversationId_messages",
    "parameters": [
     {
      "name": "conversationId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "since",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Unix seconds"
      },
      "description": "Only newer than"
     },
     {
      "name": "order",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "desc",
        "asc"
       ],
       "default": "desc"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "messages": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Message"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `chat.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "chat.read"
   }
  },
  "/chat/v1/conversations/{conversationId}/message": {
   "post": {
    "tags": [
     "Chat"
    ],
    "summary": "Send a message",
    "operationId": "post_chat_v1_conversations_conversationId_message",
    "parameters": [
     {
      "name": "conversationId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "201": {
      "description": "Sent",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "message": {
             "$ref": "#/components/schemas/Message"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Sent as the key owner.\n\nScope: `chat.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "chat.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "text"
        ],
        "properties": {
         "text": {
          "type": "string",
          "maxLength": 4000
         }
        }
       }
      }
     }
    }
   }
  },
  "/chat/v1/users/{userId}/message": {
   "post": {
    "tags": [
     "Chat"
    ],
    "summary": "Send a private message",
    "operationId": "post_chat_v1_users_userId_message",
    "parameters": [
     {
      "name": "userId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "201": {
      "description": "Sent",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "message": {
             "$ref": "#/components/schemas/Message"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "A direct message from the key owner to one person. Opens the chat if needed.\n\nScope: `chat.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "chat.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "text"
        ],
        "properties": {
         "text": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/feed/v1/posts": {
   "get": {
    "tags": [
     "Feed"
    ],
    "summary": "Get posts",
    "operationId": "get_feed_v1_posts",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "since",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Unix seconds"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "posts": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Post"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `feed.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "feed.read"
   },
   "post": {
    "tags": [
     "Feed"
    ],
    "summary": "Publish a post",
    "operationId": "post_feed_v1_posts",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Published",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "post": {
             "$ref": "#/components/schemas/Post"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Posts to the company feed as the key owner. People are notified as usual.\n\nScope: `feed.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "feed.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "title"
        ],
        "properties": {
         "title": {
          "type": "string"
         },
         "body": {
          "type": "string"
         },
         "audienceRoleIds": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "uuid"
          },
          "description": "Defaults to everyone"
         },
         "requireAcknowledgement": {
          "type": "boolean"
         },
         "pinned": {
          "type": "boolean"
         },
         "allowComments": {
          "type": "boolean",
          "default": true
         }
        }
       }
      }
     }
    }
   }
  },
  "/kb/v1/articles": {
   "get": {
    "tags": [
     "Knowledge base"
    ],
    "summary": "Get articles",
    "operationId": "get_kb_v1_articles",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "category",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "search",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Full-text search"
     },
     {
      "name": "modifiedSince",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Unix seconds"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "articles": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Article"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `kb.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "kb.read"
   }
  },
  "/kb/v1/articles/{articleId}": {
   "get": {
    "tags": [
     "Knowledge base"
    ],
    "summary": "Get an article",
    "operationId": "get_kb_v1_articles_articleId",
    "parameters": [
     {
      "name": "articleId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "article": {
             "$ref": "#/components/schemas/Article"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `kb.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "kb.read"
   }
  },
  "/hr/v1/employees": {
   "get": {
    "tags": [
     "HR"
    ],
    "summary": "Get HR records",
    "operationId": "get_hr_v1_employees",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "employees": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Employee"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `hr.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "hr.read"
   }
  },
  "/hr/v1/certifications": {
   "get": {
    "tags": [
     "HR"
    ],
    "summary": "Get licences and certifications",
    "operationId": "get_hr_v1_certifications",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     },
     {
      "name": "userIds",
      "in": "query",
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       }
      },
      "style": "form",
      "explode": true,
      "description": "Repeat or comma-separate"
     },
     {
      "name": "expiringBefore",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date",
       "example": "2026-11-02"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "certifications": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Certification"
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `hr.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "hr.read"
   }
  },
  "/settings/v1/webhooks": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Get webhooks",
    "operationId": "get_settings_v1_webhooks",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "webhooks": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Webhook"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `webhooks.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.read"
   },
   "post": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Create a webhook",
    "operationId": "post_settings_v1_webhooks",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "webhook": {
             "$ref": "#/components/schemas/Webhook"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The response includes `secretKey` once. Every delivery carries it in `x-webhook-secret`.\n\nScope: `webhooks.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookInput"
       }
      }
     }
    }
   }
  },
  "/settings/v1/webhooks/event-types": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Get event types",
    "operationId": "get_settings_v1_webhooks_event_types",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "eventTypes": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `webhooks.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.read"
   }
  },
  "/settings/v1/webhooks/{webhookId}": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Get a webhook",
    "operationId": "get_settings_v1_webhooks_webhookId",
    "parameters": [
     {
      "name": "webhookId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "webhook": {
             "$ref": "#/components/schemas/Webhook"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `webhooks.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.read"
   },
   "put": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Update a webhook",
    "operationId": "put_settings_v1_webhooks_webhookId",
    "parameters": [
     {
      "name": "webhookId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "webhook": {
             "$ref": "#/components/schemas/Webhook"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `webhooks.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookInput"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Delete a webhook",
    "operationId": "delete_settings_v1_webhooks_webhookId",
    "parameters": [
     {
      "name": "webhookId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "deletedId": {
             "type": "string",
             "format": "uuid"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `webhooks.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.write"
   }
  },
  "/settings/v1/webhooks/{webhookId}/test": {
   "post": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Send a test event",
    "operationId": "post_settings_v1_webhooks_webhookId_test",
    "parameters": [
     {
      "name": "webhookId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     }
    ],
    "responses": {
     "202": {
      "description": "Queued",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "sent": {
             "type": "boolean"
            },
            "eventType": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope: `webhooks.write`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.write"
   }
  },
  "/settings/v1/webhooks/{webhookId}/deliveries": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Get recent deliveries",
    "operationId": "get_settings_v1_webhooks_webhookId_deliveries",
    "parameters": [
     {
      "name": "webhookId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": ""
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 10,
       "minimum": 1,
       "maximum": 500
      },
      "description": "Results per page"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 0,
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "requestId": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "deliveries": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "integer"
               },
               "eventType": {
                "type": "string"
               },
               "status": {
                "type": "string",
                "enum": [
                 "pending",
                 "sent",
                 "delivered",
                 "failed"
                ]
               },
               "attempts": {
                "type": "integer"
               },
               "responseCode": {
                "type": "integer"
               },
               "error": {
                "type": "string"
               },
               "createdAt": {
                "type": "integer",
                "description": "Unix seconds"
               },
               "payload": {
                "type": "object"
               }
              }
             }
            }
           }
          },
          "paging": {
           "$ref": "#/components/schemas/Paging"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Missing scope or not allowed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The last 30 days of deliveries, newest first, with their payloads.\n\nScope: `webhooks.read`",
    "security": [
     {
      "ApiKey": []
     }
    ],
    "x-scope": "webhooks.read"
   }
  }
 },
 "components": {
  "securitySchemes": {
   "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-KEY"
   }
  },
  "schemas": {
   "Paging": {
    "type": "object",
    "properties": {
     "offset": {
      "type": "integer",
      "description": "Offset to request next"
     },
     "total": {
      "type": "integer",
      "description": "Matches in total"
     }
    }
   },
   "Error": {
    "type": "object",
    "properties": {
     "requestId": {
      "type": "string"
     },
     "detail": {
      "oneOf": [
       {
        "type": "string"
       },
       {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/ValidationError"
        }
       }
      ]
     }
    }
   },
   "ValidationError": {
    "type": "object",
    "properties": {
     "loc": {
      "type": "array",
      "items": {
       "oneOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      }
     },
     "msg": {
      "type": "string"
     },
     "type": {
      "type": "string"
     }
    }
   },
   "User": {
    "type": "object",
    "properties": {
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "firstName": {
      "type": "string"
     },
     "lastName": {
      "type": "string"
     },
     "fullName": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "phoneNumber": {
      "type": "string"
     },
     "jobTitle": {
      "type": "string"
     },
     "userType": {
      "type": "string",
      "enum": [
       "user",
       "manager",
       "owner"
      ],
      "description": "From the base of the person's role: technician → user, office → manager, admin → owner"
     },
     "role": {
      "type": "object",
      "properties": {
       "roleId": {
        "type": "string",
        "format": "uuid"
       },
       "name": {
        "type": "string"
       },
       "base": {
        "type": "string",
        "enum": [
         "technician",
         "office",
         "admin"
        ]
       }
      }
     },
     "branch": {
      "type": "object",
      "properties": {
       "branchId": {
        "type": "string",
        "format": "uuid"
       },
       "name": {
        "type": "string"
       }
      }
     },
     "isArchived": {
      "type": "boolean"
     },
     "profilePictureUrl": {
      "type": "string"
     },
     "createdAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "modifiedAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "lastLogin": {
      "type": "integer",
      "description": "Unix seconds"
     }
    }
   },
   "UserInput": {
    "type": "object",
    "required": [
     "email"
    ],
    "properties": {
     "firstName": {
      "type": "string"
     },
     "lastName": {
      "type": "string"
     },
     "fullName": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "phoneNumber": {
      "type": "string"
     },
     "jobTitle": {
      "type": "string"
     },
     "roleId": {
      "type": "string",
      "format": "uuid"
     },
     "branchId": {
      "type": "string",
      "format": "uuid"
     }
    }
   },
   "UserUpdate": {
    "type": "object",
    "properties": {
     "firstName": {
      "type": "string"
     },
     "lastName": {
      "type": "string"
     },
     "fullName": {
      "type": "string"
     },
     "phoneNumber": {
      "type": "string"
     },
     "jobTitle": {
      "type": "string"
     },
     "roleId": {
      "type": "string",
      "format": "uuid"
     },
     "branchId": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid",
      "description": "null removes the branch"
     }
    }
   },
   "Role": {
    "type": "object",
    "properties": {
     "roleId": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "base": {
      "type": "string"
     },
     "isBuiltIn": {
      "type": "boolean"
     }
    }
   },
   "Branch": {
    "type": "object",
    "properties": {
     "branchId": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "address": {
      "type": "string"
     },
     "phone": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "description": {
      "type": "string"
     }
    }
   },
   "TimePoint": {
    "type": "object",
    "properties": {
     "timestamp": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "timezone": {
      "type": "string",
      "example": "America/Toronto"
     },
     "locationData": {
      "type": "object",
      "properties": {
       "latitude": {
        "type": "number"
       },
       "longitude": {
        "type": "number"
       },
       "accuracy": {
        "type": "number",
        "description": "metres"
       }
      }
     }
    }
   },
   "Shift": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "start": {
      "$ref": "#/components/schemas/TimePoint"
     },
     "end": {
      "$ref": "#/components/schemas/TimePoint"
     },
     "breakMinutes": {
      "type": "integer"
     },
     "onBreakSince": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "workedMinutes": {
      "type": "integer"
     },
     "isOpen": {
      "type": "boolean",
      "description": "Still clocked in"
     },
     "employeeNote": {
      "type": "string"
     },
     "isManual": {
      "type": "boolean",
      "description": "Added by a manager rather than punched"
     },
     "editedBy": {
      "type": "string",
      "format": "uuid"
     },
     "createdAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "modifiedAt": {
      "type": "integer",
      "description": "Unix seconds"
     }
    }
   },
   "ShiftInput": {
    "type": "object",
    "required": [
     "userId",
     "start",
     "end"
    ],
    "properties": {
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "start": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "end": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "breakMinutes": {
      "type": "integer",
      "minimum": 0
     },
     "employeeNote": {
      "type": "string"
     }
    }
   },
   "ShiftUpdate": {
    "type": "object",
    "properties": {
     "start": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "end": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix seconds; null re-opens the shift"
     },
     "breakMinutes": {
      "type": "integer"
     },
     "employeeNote": {
      "type": "string"
     }
    }
   },
   "Punch": {
    "type": "object",
    "required": [
     "userId"
    ],
    "properties": {
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "note": {
      "type": "string"
     },
     "latitude": {
      "type": "number"
     },
     "longitude": {
      "type": "number"
     }
    }
   },
   "TimeOffRequest": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "policyTypeId": {
      "type": "string",
      "format": "uuid"
     },
     "policyTypeName": {
      "type": "string"
     },
     "isAllDay": {
      "type": "boolean"
     },
     "startDate": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "endDate": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "startTime": {
      "type": "string",
      "example": "09:00"
     },
     "endTime": {
      "type": "string",
      "example": "13:00"
     },
     "timezone": {
      "type": "string"
     },
     "duration": {
      "type": "object",
      "properties": {
       "value": {
        "type": "number"
       },
       "units": {
        "type": "string",
        "enum": [
         "hours"
        ]
       }
      }
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "approved",
       "denied",
       "cancelled"
      ]
     },
     "employeeNote": {
      "type": "string"
     },
     "managerNote": {
      "type": "string"
     },
     "replyingManagerId": {
      "type": "string",
      "format": "uuid"
     },
     "reviewedAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "createdAt": {
      "type": "integer",
      "description": "Unix seconds"
     }
    }
   },
   "TimeOffInput": {
    "type": "object",
    "required": [
     "userId",
     "policyTypeId",
     "startDate",
     "hours"
    ],
    "properties": {
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "policyTypeId": {
      "type": "string",
      "format": "uuid"
     },
     "startDate": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "endDate": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "hours": {
      "type": "number"
     },
     "startTime": {
      "type": "string",
      "description": "HH:MM, part-day only (same start and end date)"
     },
     "endTime": {
      "type": "string"
     },
     "employeeNote": {
      "type": "string"
     }
    }
   },
   "PolicyType": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "isPaid": {
      "type": "boolean"
     },
     "tracksBalance": {
      "type": "boolean"
     },
     "accrues": {
      "type": "boolean"
     },
     "color": {
      "type": "string"
     },
     "isArchived": {
      "type": "boolean"
     }
    }
   },
   "Balance": {
    "type": "object",
    "properties": {
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "policyTypes": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "policyTypeId": {
         "type": "string",
         "format": "uuid"
        },
        "name": {
         "type": "string"
        },
        "isPaid": {
         "type": "boolean"
        },
        "tracksBalance": {
         "type": "boolean"
        },
        "grantedHours": {
         "type": "number"
        },
        "usedHours": {
         "type": "number"
        },
        "pendingHours": {
         "type": "number"
        },
        "availableHours": {
         "type": "number"
        },
        "accruedHours": {
         "type": "number"
        },
        "accrualRatePer100Hours": {
         "type": "number"
        }
       }
      }
     }
    }
   },
   "Conversation": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "type": {
      "type": "string",
      "enum": [
       "private",
       "group",
       "channel"
      ]
     },
     "name": {
      "type": "string"
     },
     "otherUserId": {
      "type": "string",
      "format": "uuid"
     },
     "memberCount": {
      "type": "integer"
     },
     "unreadCount": {
      "type": "integer"
     },
     "lastMessageAt": {
      "type": "integer",
      "description": "Unix seconds"
     }
    }
   },
   "Message": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "conversationId": {
      "type": "string",
      "format": "uuid"
     },
     "senderId": {
      "type": "string",
      "format": "uuid"
     },
     "text": {
      "type": "string"
     },
     "attachment": {
      "type": "object",
      "properties": {
       "name": {
        "type": "string"
       },
       "mimeType": {
        "type": "string"
       },
       "size": {
        "type": "integer"
       }
      }
     },
     "mentions": {
      "type": "array",
      "items": {
       "type": "string",
       "format": "uuid"
      }
     },
     "replyTo": {
      "type": "string",
      "format": "uuid"
     },
     "isDeleted": {
      "type": "boolean"
     },
     "createdAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "editedAt": {
      "type": "integer",
      "description": "Unix seconds"
     }
    }
   },
   "Post": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "authorId": {
      "type": "string",
      "format": "uuid"
     },
     "title": {
      "type": "string"
     },
     "body": {
      "type": "string"
     },
     "hasImage": {
      "type": "boolean"
     },
     "requireAcknowledgement": {
      "type": "boolean"
     },
     "pinned": {
      "type": "boolean"
     },
     "allowComments": {
      "type": "boolean"
     },
     "audienceRoleIds": {
      "type": "array",
      "items": {
       "type": "string",
       "format": "uuid"
      }
     },
     "createdAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "modifiedAt": {
      "type": "integer",
      "description": "Unix seconds"
     }
    }
   },
   "Article": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "title": {
      "type": "string"
     },
     "category": {
      "type": "string"
     },
     "body": {
      "type": "string",
      "description": "Markdown (single article only)"
     },
     "pinned": {
      "type": "boolean"
     },
     "sourceUrl": {
      "type": "string"
     },
     "attachments": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "createdAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "modifiedAt": {
      "type": "integer",
      "description": "Unix seconds"
     }
    }
   },
   "Employee": {
    "type": "object",
    "properties": {
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "hireDate": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "employmentType": {
      "type": "string"
     },
     "payRate": {
      "type": "number"
     },
     "dateOfBirth": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "address": {
      "type": "string"
     },
     "emergencyContact": {
      "type": "object",
      "properties": {
       "name": {
        "type": "string"
       },
       "phone": {
        "type": "string"
       }
      }
     },
     "licenseNumber": {
      "type": "string"
     },
     "licenseExpiry": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "accrualRatePer100Hours": {
      "type": "number"
     }
    }
   },
   "Certification": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "userId": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "number": {
      "type": "string"
     },
     "issuedOn": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "expiresOn": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "notes": {
      "type": "string"
     }
    }
   },
   "Webhook": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string"
     },
     "url": {
      "type": "string"
     },
     "eventTypes": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "isDisabled": {
      "type": "boolean"
     },
     "createdAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "lastSuccessAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "lastFailureAt": {
      "type": "integer",
      "description": "Unix seconds"
     },
     "failuresInARow": {
      "type": "integer"
     },
     "secretKey": {
      "type": "string",
      "description": "Only in the response to creating it"
     }
    }
   },
   "WebhookInput": {
    "type": "object",
    "required": [
     "name",
     "url",
     "eventTypes"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "url": {
      "type": "string",
      "description": "https:// only"
     },
     "eventTypes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Event names, or [\"*\"] for all"
     },
     "isDisabled": {
      "type": "boolean"
     }
    }
   },
   "Timesheet": {
    "type": "object",
    "properties": {
     "startDate": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "endDate": {
      "type": "string",
      "format": "date",
      "example": "2026-11-02"
     },
     "timezone": {
      "type": "string"
     },
     "rules": {
      "type": "object",
      "description": "The company's payroll rules (Office Admin → Payroll rules)"
     },
     "users": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "userId": {
         "type": "string",
         "format": "uuid"
        },
        "fullName": {
         "type": "string"
        },
        "workedHours": {
         "type": "number"
        },
        "regularHours": {
         "type": "number"
        },
        "overtimeHours": {
         "type": "number"
        },
        "holidayPayHours": {
         "type": "number"
        },
        "holidayPremiumHours": {
         "type": "number"
        },
        "paidTimeOffHours": {
         "type": "object",
         "additionalProperties": {
          "type": "number"
         }
        },
        "unpaidTimeOffHours": {
         "type": "number"
        },
        "daysWorked": {
         "type": "integer"
        },
        "isClockedIn": {
         "type": "boolean"
        },
        "weeks": {
         "type": "array",
         "items": {
          "type": "object"
         }
        },
        "holidays": {
         "type": "array",
         "items": {
          "type": "object"
         }
        },
        "substituteDaysOff": {
         "type": "array",
         "items": {
          "type": "object"
         }
        },
        "flags": {
         "type": "array",
         "items": {
          "type": "string"
         }
        },
        "payRate": {
         "type": "number",
         "description": "Only with hr.read"
        },
        "estimatedGross": {
         "type": "number",
         "description": "Only with hr.read"
        }
       }
      }
     }
    }
   }
  }
 }
}