---
title: "Create time entry"
method: POST
path: "/v2/users/{user_id}/time_entries"
tags: ["time_entries"]
---

# Create time entry

`POST /v2/users/{user_id}/time_entries`

## Request

- Base URL: `https://api.hubstaff.com`
- URL: `https://api.hubstaff.com/v2/users/{user_id}/time_entries`
- Auth: OAuth 2
  - Authorization code: `https://account.hubstaff.com/authorizations/new`
  - Token URL: `https://account.hubstaff.com/access_tokens` scopes: `hubstaff:read`, `hubstaff:write`
- TypeScript: <https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/docs/v2/users/:user_id/time_entries/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new time entry.

Returns {success: true} on success.

Note: Manual time entries that require approval cannot be added through the API.

## Path parameters

- `user_id` integer, required

## Request body

- PostV2UsersUserIdTimeEntries: Create time entry
  - `billable` boolean: Whether the time is billable or not. Defaults to the project setting.
  - `note` string: (it's REQUIRED by default) Can be modified to be optional in the Require Reason setting
  - `project_id` integer, required: Project ID
  - `start_time` string, date-time, required: The start time for the activity in ISO8601 format
  - `tracked` integer, required: The number of seconds tracked
  - `task_id` integer: Task ID

## Response `201`

Time entry created

## Other responses

- `400`: Invalid parameters
- `401`: Unauthorized
- `403`: API access is only for organizations on an active plan
- `404`: Could not find record
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api.md) - [All operations](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/revisions/c6b90e4e4bdc?raw)
