# “Time entries” Endpoints - POST Time Entries

**URL:** <https://community.toggl.com/t/time-entries-endpoints-post-time-entries/185>\
**Category:** API References\
**Tags:** time-entries, api, me-endpoint, post, create\
**Created:** [November 21, 2024, 12:58pm UTC](https://community.toggl.com/t/time-entries-endpoints-post-time-entries/185 "2024-11-21T12:58:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Support](https://yyz2.discourse-cdn.com/flex012/user_avatar/community.toggl.com/support/32/1577_2.png) [@Support](https://community.toggl.com/u/Support)\
**Post date:** [November 21, 2024, 12:58pm UTC](https://community.toggl.com/t/time-entries-endpoints-post-time-entries/185/1 "2024-11-21T12:58:00Z")

</div>

```auto
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries

```

Creates a new workspace Time Entry.

- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust

```auto
extern crate tokio;extern crate serde_json;use reqwest::{Client};use reqwest::header::{CONTENT_TYPE};#[tokio::main]async fn main() -> Result<(), reqwest::Error> { let client = Client::new().basic_auth("<email>", "<password>"); let json = client.request(Method::POST, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries".to_string()).json(&serde_json::json!(\{"billable":"boolean","created_with":"string","description":"string","duration":"integer","duronly":"boolean","event_metadata":\{"origin_feature":"string","visible_goals_count":"integer"\},"pid":"integer","project_id":"integer","shared_with_user_ids":[\{\}],"start":"string","start_date":"string","stop":"string","tag_action":"string","tag_ids":[\{\}],"tags":[\{\}],"task_id":"integer","tid":"integer","uid":"integer","user_id":"integer","wid":"integer","workspace_id":"integer"\})) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}

```

### Parameters[​](https://engineering.toggl.com/docs/api/time_entries/#parameters-2)

#### Path[​](https://engineering.toggl.com/docs/api/time_entries/#path-1)

| name | type | required | description |
| --- | --- | --- | --- |
| workspace\_id | integer | true | Numeric ID of the workspace |

#### Query[​](https://engineering.toggl.com/docs/api/time_entries/#query-3)

| name | type | required | description |
| --- | --- | --- | --- |
| meta | boolean | false | Should the response contain data for meta entities |

#### Body[​](https://engineering.toggl.com/docs/api/time_entries/#body)

| Name | Type | Description |
| --- | --- | --- |
| 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. |
| event\_metadata | object | - |
| pid | integer | Project ID, legacy field |
| project\_id | integer | Project ID, optional |
| shared\_with\_user\_ids | Array of 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 | Array of integer | IDs of tags to add/remove |
| tags | Array of 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 |

##### event\_metadata[​](https://engineering.toggl.com/docs/api/time_entries/#event_metadata)

| Name | Type | Description |
| --- | --- | --- |
| origin\_feature | string | - |
| visible\_goals\_count | integer | - |

### Response[​](https://engineering.toggl.com/docs/api/time_entries/#response-3)

#### 200[​](https://engineering.toggl.com/docs/api/time_entries/#200-3)

A workspace TimeEntry.

| Name | Type | Description |
| --- | --- | --- |
| 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 | null |
| 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 | Array of string | Permission list |
| pid | integer | Project ID, legacy field |
| project\_active | boolean | - |
| project\_billable | boolean | - |
| project\_color | string | - |
| project\_id | integer | null |
| project\_name | string | - |
| shared\_with | Array of object | Indicates who the time entry has been shared with |
| 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 | Array of integer | Tag IDs, null if tags were not provided or were later deleted |
| tags | Array of string | Tag names, null if tags were not provided or were later deleted |
| task\_id | integer | null |
| task\_name | string | - |
| tid | integer | Task ID, legacy field |
| uid | integer | Time Entry creator ID, legacy field |
| user\_avatar\_url | string | - |
| user\_id | integer | Time Entry creator ID |
| user\_name | string | - |
| wid | integer | Workspace ID, legacy field |
| workspace\_id | integer | Workspace ID |

##### shared\_with[​](https://engineering.toggl.com/docs/api/time_entries/#shared_with-3)

| Name | Type | Description |
| --- | --- | --- |
| accepted | boolean | - |
| user\_id | integer | - |
| user\_name | string | - |

#### 403[​](https://engineering.toggl.com/docs/api/time_entries/#403-2)

User does not have access to this resource.

#### 500[​](https://engineering.toggl.com/docs/api/time_entries/#500-3)

Internal Server Error
