“Time entries” Endpoints - GET a time entry by ID

https://api.track.toggl.com/api/v9/me/time_entries/{time_entry_id}

Load time entry by ID that is accessible by the current user.

  • cURL
  • Go
  • Ruby
  • JavaScript
  • Python
  • Rust
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::GET, "https://api.track.toggl.com/api/v9/me/time_entries/{time_entry_id}".to_string())  .header(CONTENT_TYPE, "application/json")  .send()  .await?  .json()  .await?;    println!("{:#?}", json);  Ok(())}

Parameters

Path

name type required description
time_entry_id integer true TimeEntry ID.

Query

name type required description
meta boolean false Should the response contain data for meta entities
include_sharing boolean false Include sharing details in the response

Response

200

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
Name Type Description
accepted boolean -
user_id integer -
user_name string -

404

Resource can not be found

500

Internal Server Error

How can I retrieve historical time entries? The v9 version doesn’t allow retrieving time entries older than 3 months.

Hi there! Thanks for the question!

Using the /me endpoint is similar to using the Timer page in the Track app. To go further back you should use the Reports API. We are still moving documentation over to this forum, here’s how you can get time entries for a custom date range using the Detailed report: Detailed Report Endpoints - POST Search time entries

Please remember that results are paginated :slight_smile:

More Reporting API posts incoming!