---
title: "TimeEntries"
method: POST
path: "/workspaces/{workspace_id}/time_entries"
tags: ["time_entries"]
---

# TimeEntries

`POST /workspaces/{workspace_id}/time_entries`

## Request

- Base URL: `https://localhost:8080/api/v9`
- URL: `https://localhost:8080/api/v9/workspaces/{workspace_id}/time_entries`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/toggl/apis/toggl-api/docs/workspaces/:workspace_id/time_entries/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new workspace TimeEntry.

## Path parameters

- `workspace_id` integer, required

## Query parameters

- `meta` boolean

## Request body

- TimeentryPayload
  - `billable` boolean: Whether the time entry is marked as billable, optional, default false
  - `created_with` string: Must be provided when creating a time entry and should identify the service/application used to create it
  - `description` string: Time entry description, optional
  - `duration` integer: Time entry duration. For running entries should be negative, preferable -1
  - `duronly` boolean: Deprecated: Used to create a time entry with a duration but without a stop time. This parameter can be ignored.
  - `pid` integer: Project ID, legacy field
  - `project_id` integer: Project ID, optional
  - `shared_with_user_ids` integer[]: List of user IDs to share this time entry with
  - `start` string: Start time in UTC, required for creation. Format: 2006-01-02T15:04:05Z
  - `start_date` string: If provided during creation, the date part will take precedence over the date part of "start". Format: 2006-11-07
  - `stop` string: Stop time in UTC, can be omitted if it's still running or created with "duration". If "stop" and "duration" are provided, values must be consistent (start + duration == stop)
  - `tag_action` string: Can be "add" or "delete". Used when updating an existing time entry
  - `tag_ids` integer[]: IDs of tags to add/remove
  - `tags` string[]: Names of tags to add/remove. If name does not exist as tag, one will be created automatically
  - `task_id` integer: Task ID, optional
  - `tid` integer: Task ID, legacy field
  - `uid` integer: Time Entry creator ID, legacy field
  - `user_id` integer: Time Entry creator ID, if omitted will use the requester user ID
  - `wid` integer: Workspace ID, legacy field
  - `workspace_id` integer: Workspace ID, required

## Response `200`

A workspace TimeEntry.

- ModelsTimeEntry
  - `at` string: When was last updated
  - `billable` boolean: Whether the time entry is marked as billable
  - `client_name` string: Related entities meta fields - if requested
  - `description` string, nullable: Time Entry description, null if not provided at creation/update
  - `duration` integer: Time entry duration. For running entries should be negative, preferable -1
  - `duronly` boolean: Used to create a TE with a duration but without a stop time, this field is deprecated for GET endpoints where the value will always be true.
  - `id` integer: Time Entry ID
  - `permissions` string[]: Permission list
  - `pid` integer: Project ID, legacy field
  - `project_active` boolean
  - `project_color` string
  - `project_id` integer, nullable: Project ID. Can be null if project was not provided or project was later deleted
  - `project_name` string
  - `server_deleted_at` string, nullable: When was deleted, null if not deleted
  - `shared_with` ModelsTimeEntrySharedWith[]: Indicates who the time entry has been shared with
    - `accepted` boolean
    - `user_id` integer
    - `user_name` string
  - `start` string: Start time in UTC
  - `stop` string: Stop time in UTC, can be null if it's still running or created with "duration" and "duronly" fields
  - `tag_ids` integer[]: Tag IDs, null if tags were not provided or were later deleted
  - `tags` string[]: Tag names, null if tags were not provided or were later deleted
  - `task_id` integer, nullable: Task ID. Can be null if task was not provided or project was later deleted
  - `task_name` string
  - `tid` integer: Task ID, legacy field
  - `uid` integer: Time Entry creator ID, legacy field
  - `user_id` integer: Time Entry creator ID
  - `wid` integer: Workspace ID, legacy field
  - `workspace_id` integer: Workspace ID

## Other responses

- `403`: User does not have access to this resource.
- `500`: Internal Server Error

---

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