# POST /time-entries

**Resource:** [TIME_ENTRIES](./time-entries.md)  
**MCP tool:** `create_time_entry`  
**Scopes:** `time-entries:write`  
**Write operation:** yes

Log a finished stretch of work by hand, after the fact ("I worked 2 hours on the Smith job this morning"). Send started_at and exactly one of ended_at or duration_minutes. Link it to what the work was for (opportunity_id, work_order_id, task_id, contact_id) and put a labour product on it (product_id) so it can be invoiced at that product's price; a work order or task fills in its opportunity when none is sent. The time is logged for the caller unless user_id names someone else, which needs a workspace admin. Refused: an entry longer than 24 hours, a start more than a day in the future, both or neither of ended_at and duration_minutes, and a linked record that is not in this workspace. To time work as it happens, use start_timer instead.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `started_at` | body | string | yes | When the work started, as an ISO date-time with its offset, for example 2026-11-15T09:00:00+11:00. Without an offset it is read as UTC. |
| `ended_at` | body | string | no | When the work stopped (ISO date-time). Send this OR duration_minutes, not both. |
| `duration_minutes` | body | number | no | How long the work took, in minutes (above 0, at most 1440). Send this OR ended_at, not both. |
| `user_id` | body | string | no | Who did the work (user UUID). Leave out for the caller. Logging time for someone else needs a workspace admin, and that person must be a member of this workspace. |
| `note` | body | string | no | What was done, in a sentence or two (2000 characters at most). |
| `billable` | body | boolean | no | Whether the time can be invoiced. Defaults to true. |
| `opportunity_id` | body | string | no | UUID of the opportunity the work was for (from list_opportunities). Needed before the time can be invoiced. |
| `work_order_id` | body | string | no | UUID of the work order the work was done on. When no opportunity_id is sent, the work order's opportunity is used. |
| `task_id` | body | string | no | UUID of the task the work was done on. When no opportunity_id is sent, the task's opportunity is used. |
| `contact_id` | body | string | no | UUID of the contact the work was for. |
| `product_id` | body | string | no | UUID of the labour product (from list_products) whose price is the hourly rate when this time is invoiced. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/time-entries"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"started_at":"...","ended_at":"...","duration_minutes":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`