https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets/{setup_id}/{start_date}
Updates a timesheet.
- 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::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets/{setup_id}/{start_date}".to_string()).json(&serde_json::json!(\{"rejection_comment":"string","status":"string"\})) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}
Parameters
Path
| name |
type |
required |
description |
| workspace_id |
integer |
true |
Numeric ID of the workspace |
| setup_id |
integer |
true |
Numeric ID of the timesheet setup. |
| start_date |
string |
true |
Start date (YYYY-MM-DD) of the timesheet. |
Body
| Name |
Type |
Description |
| rejection_comment |
string |
- |
| status |
string |
- |
Response
200
| Name |
Type |
Description |
| approved_or_rejected_at |
string |
- |
| approved_or_rejected_id |
integer |
- |
| approved_or_rejected_name |
string |
- |
| approver_id |
integer |
- |
| approver_name |
string |
- |
| approvers |
Array of object |
- |
| end_date |
string |
- |
| errors |
Array of object |
- |
| member_id |
integer |
- |
| member_name |
string |
- |
| period_editable |
boolean |
- |
| period_end |
string |
- |
| period_locked |
boolean |
- |
| period_start |
string |
- |
| periodicity |
string |
- |
| permissions |
string |
- |
| rejection_comment |
string |
- |
| reminder_day |
string |
- |
| reminder_sent_at |
string |
- |
| reminder_time |
string |
- |
| reviews |
Array of object |
- |
| start_date |
string |
- |
| status |
string |
- |
| submitted_at |
string |
- |
| timesheet_setup_id |
integer |
- |
| working_hours_in_minutes |
integer |
- |
| workspace_id |
integer |
- |
approvers
| Name |
Type |
Description |
| name |
string |
- |
| user_id |
integer |
- |
errors
| Name |
Type |
Description |
| code |
string |
- |
| message |
string |
- |
reviews
| Name |
Type |
Description |
| approved |
boolean |
- |
| name |
string |
- |
| rejection_comment |
string |
- |
| user_id |
integer |
- |
400
Possible error messages:
- Workspace not found
- Invalid ID
- Invalid date
- Invalid status
- Invalid status for rejection comment
- Invalid timesheet transition
402
Approvals are a premium feature
403
User does not have access to this resource
500
Internal Server Error