Projects
GET Get workspace projects users​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users
List all projects users for a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.get('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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/workspaces/{workspace_id}/project_users".to_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 |
Query​
name | type | required | description |
---|---|---|---|
project_ids | string | false | Numeric IDs of projects, comma-separated |
with_group_members | boolean | false | Include group members |
Response​
200​
Array of:
name | type | description |
---|---|---|
at | string | When was last modified |
gid | integer | Group ID, legacy field |
group_id | integer | Group ID |
id | integer | Project User ID |
labour_cost | integer | Labour cost for this project user |
manager | boolean | Whether the user is manager of the project |
project_id | integer | Project ID |
rate | number | null | Custom rate for project user |
rate_last_updated | string | Date for rate last updated |
user_id | integer | User ID |
workspace_id | integer | Workspace ID |
400​
Possible error messages:
* Workspace not found
* project_ids cannot exceed 200 elements.
403​
User does not have access to this resource.
500​
Internal Server Error
POST Add an user into workspace projects users​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users
Include a project user for a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users \
-H "Content-Type: application/json" \
-d '{"labour_cost":"integer","manager":"boolean","project_id":"integer","rate":"number","rate_change_mode":"string","use_last_labour_cost":"boolean","user_id":"integer"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"labour_cost":"integer","manager":"boolean","project_id":"integer","rate":"number","rate_change_mode":"string","use_last_labour_cost":"boolean","user_id":"integer"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"labour_cost":"integer","manager":"boolean","project_id":"integer","rate":"number","rate_change_mode":"string","use_last_labour_cost":"boolean","user_id":"integer"}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users", {
method: "POST",
body: {"labour_cost":"integer","manager":"boolean","project_id":"integer","rate":"number","rate_change_mode":"string","use_last_labour_cost":"boolean","user_id":"integer"},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users', json='{"labour_cost":"integer","manager":"boolean","project_id":"integer","rate":"number","rate_change_mode":"string","use_last_labour_cost":"boolean","user_id":"integer"}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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}/project_users".to_string())
.json(&serde_json::json!({"labour_cost":"integer","manager":"boolean","project_id":"integer","rate":"number","rate_change_mode":"string","use_last_labour_cost":"boolean","user_id":"integer"}))
.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 |
Body​
name | type | description |
---|---|---|
labour_cost | integer | Labour cost for this project user |
manager | boolean | Whether the user will be manager of the project |
project_id | integer | Project ID |
rate | number | Rate for this project user |
rate_change_mode | string | Rate change mode for this project user. Can be "start-today", "override-current", "override-all" |
use_last_labour_cost | boolean | Whether the last labour cost should be applied or not, default false |
user_id | integer | User ID |
Response​
200​
name | type | description |
---|---|---|
at | string | When was last modified |
gid | integer | Group ID, legacy field |
group_id | integer | Group ID |
id | integer | Project User ID |
labour_cost | integer | Labour cost for this project user |
manager | boolean | Whether the user is manager of the project |
project_id | integer | Project ID |
rate | number | null | Custom rate for project user |
rate_last_updated | string | Date for rate last updated |
user_id | integer | User ID |
workspace_id | integer | Workspace ID |
400​
Possible error messages:
* Workspace not found
* Invalid project_id
* Invalid user_id
403​
User does not have access to this resource.
500​
Internal Server Error
PATCH Patch project users from workspace​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_ids}
Patch a list of project users for a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_ids} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_ids}")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_ids}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Patch.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_ids}", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.patch('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_ids}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::PATCH, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_ids}".to_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 |
Query​
name | type | required | description |
---|---|---|---|
project_user_ids | []integer | true | Numeric IDs of the project users |
Response​
200​
name | type | description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
failure | Array of
| List of found errors | |||||||||
success | Array of integer | List of org user IDs that were successfully patched |
400​
Possible error messages:
* Invalid value as user IDs
* No patchable fields defined
* PATCH expects at least one ID
* PATCH request is limited to %d entries at once
* Invalid op:
* Invalid path format:
* Path not found:
* Operation not supported ({patch_operation} {patch_path})
* Invalid path
* /manager expects a boolean
* /labour_cost expects an int64 or null
* /rate expects an float64 or null
* Operation not supported (add /labour_cost)
* Operation not supported (add /rate)
* Operation not supported (add /manager)
403​
User does not have access to this resource.
500​
Internal Server Error
PUT Update an user into workspace projects users​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}
Update the data for a project user for a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id} \
-H "Content-Type: application/json" \
-d '{"labour_cost":"integer","manager":"boolean","rate":"number","rate_change_mode":"string"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"labour_cost":"integer","manager":"boolean","rate":"number","rate_change_mode":"string"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"labour_cost":"integer","manager":"boolean","rate":"number","rate_change_mode":"string"}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}", {
method: "PUT",
body: {"labour_cost":"integer","manager":"boolean","rate":"number","rate_change_mode":"string"},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}', json='{"labour_cost":"integer","manager":"boolean","rate":"number","rate_change_mode":"string"}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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}/project_users/{project_user_id}".to_string())
.json(&serde_json::json!({"labour_cost":"integer","manager":"boolean","rate":"number","rate_change_mode":"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 |
project_user_id | integer | true | Numeric ID of the project user |
Body​
name | type | description |
---|---|---|
labour_cost | integer | Labour cost for this project user |
manager | boolean | Whether the user will be manager of the project |
rate | number | Rate for this project user |
rate_change_mode | string | Rate change mode for this project user. Can be "start-today", "override-current", "override-all" |
Response​
200​
name | type | description |
---|---|---|
at | string | When was last modified |
gid | integer | Group ID, legacy field |
group_id | integer | Group ID |
id | integer | Project User ID |
labour_cost | integer | Labour cost for this project user |
manager | boolean | Whether the user is manager of the project |
project_id | integer | Project ID |
rate | number | null | Custom rate for project user |
rate_last_updated | string | Date for rate last updated |
user_id | integer | User ID |
workspace_id | integer | Workspace ID |
400​
Possible error messages:
* Workspace not found
* Missing data
* Invalid project_id
* Invalid user_id
403​
User does not have access to this resource.
500​
Internal Server Error
DELETE Delete a project user from workspace projects users​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}
Delete a project user for a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.delete('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::DELETE, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/project_users/{project_user_id}".to_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 |
project_user_id | integer | true | Numeric ID of the project user |
Response​
200​
Successful operation.
400​
Possible error messages:
* Workspace not found
* Project user not found/accessible
* Invalid project_id
403​
User does not have access to this resource.
500​
Internal Server Error
GET WorkspaceProjects​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects
Get projects for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.get('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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/workspaces/{workspace_id}/projects".to_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 |
Query​
name | type | required | description |
---|---|---|---|
active | boolean | false | active |
since | integer | false | Retrieve projects created/modified/deleted since this date using UNIX timestamp. |
billable | boolean | false | billable |
user_ids | array | false | user_ids |
client_ids | array | false | client_ids |
group_ids | array | false | group_ids |
name | string | true | name |
page | integer | true | page |
sort_field | string | true | sort_field |
sort_order | string | true | sort_order |
only_templates | boolean | true | only_templates |
per_page | integer | false | Number of items per page, default 151. Cannot exceed 200. |
Response​
200​
Array of:
name | type | description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
active | boolean | Whether the project is active or archived | |||||||||||||||||||||
actual_hours | integer | null | Actual hours | |||||||||||||||||||||
actual_seconds | integer | null | Actual seconds | |||||||||||||||||||||
at | string | Last updated date | |||||||||||||||||||||
auto_estimates | boolean | null | Whether estimates are based on task hours, premium feature | |||||||||||||||||||||
billable | boolean | null | Whether the project is billable, premium feature | |||||||||||||||||||||
cid | integer | Client ID legacy field | |||||||||||||||||||||
client_id | integer | null | Client ID | |||||||||||||||||||||
color | string | Color | |||||||||||||||||||||
created_at | string | Creation date | |||||||||||||||||||||
currency | string | null | Currency, premium feature | |||||||||||||||||||||
current_period |
| Current project period, premium feature | |||||||||||||||||||||
end_date | string | End date | |||||||||||||||||||||
estimated_hours | integer | null | Estimated hours | |||||||||||||||||||||
estimated_seconds | integer | null | Estimated seconds | |||||||||||||||||||||
first_time_entry | string | First time entry for this project. Only included if it was requested with with_first_time_entry | |||||||||||||||||||||
fixed_fee | number | Fixed fee, premium feature | |||||||||||||||||||||
id | integer | Project ID | |||||||||||||||||||||
is_private | boolean | Whether the project is private | |||||||||||||||||||||
name | string | Name | |||||||||||||||||||||
rate | number | Hourly rate | |||||||||||||||||||||
rate_last_updated | string | null | Last date for rate change | |||||||||||||||||||||
recurring | boolean | Whether the project is recurring, premium feature | |||||||||||||||||||||
recurring_parameters | Array of
| Project recurring parameters, premium feature | |||||||||||||||||||||
server_deleted_at | string | null | Deletion date | |||||||||||||||||||||
start_date | string | Start date | |||||||||||||||||||||
status | string | Status of the project (upcoming, active, ended, archived, deleted) | |||||||||||||||||||||
template | boolean | null | Whether the project is used as template, premium feature | |||||||||||||||||||||
wid | integer | Workspace ID legacy field | |||||||||||||||||||||
workspace_id | integer | Workspace ID |
403​
User does not have access to this resource.
500​
Internal Server Error
POST WorkspaceProjects​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects
Create project for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects \
-H "Content-Type: application/json" \
-d '{"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects", {
method: "POST",
body: {"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects', json='{"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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}/projects".to_string())
.json(&serde_json::json!({"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}))
.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 |
Body​
name | type | description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
active | boolean | Whether the project is active or archived | ||||||||||||
auto_estimates | boolean | Whether estimates are based on task hours, optional, premium feature | ||||||||||||
billable | boolean | Whether the project is set as billable, optional, premium feature | ||||||||||||
cid | integer | Client ID, legacy | ||||||||||||
client_id | integer | Client ID, optional | ||||||||||||
client_name | string | Client name, optional | ||||||||||||
color | string | Project color | ||||||||||||
currency | string | Project currency, optional, premium feature | ||||||||||||
end_date | string | End date of a project timeframe | ||||||||||||
estimated_hours | integer | Estimated hours, optional, premium feature | ||||||||||||
fixed_fee | number | Project fixed fee, optional, premium feature | ||||||||||||
is_private | boolean | Whether the project is private or not | ||||||||||||
name | string | Project name | ||||||||||||
rate | number | Hourly rate, optional, premium feature | ||||||||||||
rate_change_mode | string | Rate change mode, optional, premium feature. Can be "start-today", "override-current", "override-all" | ||||||||||||
recurring | boolean | Project is recurring, optional, premium feature | ||||||||||||
recurring_parameters |
| Project recurring parameters, optional, premium feature | ||||||||||||
start_date | string | Start date of a project timeframe | ||||||||||||
template | boolean | Project is template, optional, premium feature | ||||||||||||
template_id | integer | Template ID, optional |
Response​
200​
name | type | description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
active | boolean | Whether the project is active or archived | |||||||||||||||||||||
actual_hours | integer | null | Actual hours | |||||||||||||||||||||
actual_seconds | integer | null | Actual seconds | |||||||||||||||||||||
at | string | Last updated date | |||||||||||||||||||||
auto_estimates | boolean | null | Whether estimates are based on task hours, premium feature | |||||||||||||||||||||
billable | boolean | null | Whether the project is billable, premium feature | |||||||||||||||||||||
cid | integer | Client ID legacy field | |||||||||||||||||||||
client_id | integer | null | Client ID | |||||||||||||||||||||
color | string | Color | |||||||||||||||||||||
created_at | string | Creation date | |||||||||||||||||||||
currency | string | null | Currency, premium feature | |||||||||||||||||||||
current_period |
| Current project period, premium feature | |||||||||||||||||||||
end_date | string | End date | |||||||||||||||||||||
estimated_hours | integer | null | Estimated hours | |||||||||||||||||||||
estimated_seconds | integer | null | Estimated seconds | |||||||||||||||||||||
first_time_entry | string | First time entry for this project. Only included if it was requested with with_first_time_entry | |||||||||||||||||||||
fixed_fee | number | Fixed fee, premium feature | |||||||||||||||||||||
id | integer | Project ID | |||||||||||||||||||||
is_private | boolean | Whether the project is private | |||||||||||||||||||||
name | string | Name | |||||||||||||||||||||
rate | number | Hourly rate | |||||||||||||||||||||
rate_last_updated | string | null | Last date for rate change | |||||||||||||||||||||
recurring | boolean | Whether the project is recurring, premium feature | |||||||||||||||||||||
recurring_parameters | Array of
| Project recurring parameters, premium feature | |||||||||||||||||||||
server_deleted_at | string | null | Deletion date | |||||||||||||||||||||
start_date | string | Start date | |||||||||||||||||||||
status | string | Status of the project (upcoming, active, ended, archived, deleted) | |||||||||||||||||||||
template | boolean | null | Whether the project is used as template, premium feature | |||||||||||||||||||||
wid | integer | Workspace ID legacy field | |||||||||||||||||||||
workspace_id | integer | Workspace ID |
403​
User does not have access to this resource.
500​
Internal Server Error
PATCH WorkspaceProjects​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_ids}
Bulk editing workspace projects.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_ids} \
-H "Content-Type: application/json" \
-d '{"array":[{"op":{"description":"Patch operation to perform, one of "add", "remove", "replace"","type":"string"},"path":{"description":"Path to the field to patch, example: "/name"","type":"string"},"value":{"object":{},"description":"Value to set when operation is "add" or "replace", example: "New name". The value type actually depends on the field being patched."}}]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"array":[{"op":{"description":"Patch operation to perform, one of "add", "remove", "replace"","type":"string"},"path":{"description":"Path to the field to patch, example: "/name"","type":"string"},"value":{"object":{},"description":"Value to set when operation is "add" or "replace", example: "New name". The value type actually depends on the field being patched."}}]}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_ids}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_ids}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Patch.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"array":[{"op":{"description":"Patch operation to perform, one of "add", "remove", "replace"","type":"string"},"path":{"description":"Path to the field to patch, example: "/name"","type":"string"},"value":{"object":{},"description":"Value to set when operation is "add" or "replace", example: "New name". The value type actually depends on the field being patched."}}]}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_ids}", {
method: "PATCH",
body: {"array":[{"op":{"description":"Patch operation to perform, one of "add", "remove", "replace"","type":"string"},"path":{"description":"Path to the field to patch, example: "/name"","type":"string"},"value":{"object":{},"description":"Value to set when operation is "add" or "replace", example: "New name". The value type actually depends on the field being patched."}}]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.patch('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_ids}', json='{"array":[{"op":{"description":"Patch operation to perform, one of "add", "remove", "replace"","type":"string"},"path":{"description":"Path to the field to patch, example: "/name"","type":"string"},"value":{"object":{},"description":"Value to set when operation is "add" or "replace", example: "New name". The value type actually depends on the field being patched."}}]}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::PATCH, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_ids}".to_string())
.json(&serde_json::json!({"array":[{"op":{"description":"Patch operation to perform, one of "add", "remove", "replace"","type":"string"},"path":{"description":"Path to the field to patch, example: "/name"","type":"string"},"value":{"object":{},"description":"Value to set when operation is "add" or "replace", example: "New name". The value type actually depends on the field being patched."}}]}))
.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 |
project_ids | string | true | Numeric IDs of project ids, separated by comma. E.g.: 204301830,202700150,202687559 |
Body​
name | type | description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
array | Array of
| Array of batch operations |
Response​
200​
name | type | description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
failure | Array of
| - | |||||||||
success | Array of integer | - |
500​
Internal Server Error
GET WorkspaceProject​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}
Get project for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.get('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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/workspaces/{workspace_id}/projects/{project_id}".to_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 |
project_id | integer | true | Numeric ID of the project |
Query​
name | type | required | description |
---|---|---|---|
with_first_time_entry | boolean | false | Will include the first time entry date of the project |
Response​
200​
name | type | description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
active | boolean | Whether the project is active or archived | |||||||||||||||||||||
actual_hours | integer | null | Actual hours | |||||||||||||||||||||
actual_seconds | integer | null | Actual seconds | |||||||||||||||||||||
at | string | Last updated date | |||||||||||||||||||||
auto_estimates | boolean | null | Whether estimates are based on task hours, premium feature | |||||||||||||||||||||
billable | boolean | null | Whether the project is billable, premium feature | |||||||||||||||||||||
cid | integer | Client ID legacy field | |||||||||||||||||||||
client_id | integer | null | Client ID | |||||||||||||||||||||
color | string | Color | |||||||||||||||||||||
created_at | string | Creation date | |||||||||||||||||||||
currency | string | null | Currency, premium feature | |||||||||||||||||||||
current_period |
| Current project period, premium feature | |||||||||||||||||||||
end_date | string | End date | |||||||||||||||||||||
estimated_hours | integer | null | Estimated hours | |||||||||||||||||||||
estimated_seconds | integer | null | Estimated seconds | |||||||||||||||||||||
first_time_entry | string | First time entry for this project. Only included if it was requested with with_first_time_entry | |||||||||||||||||||||
fixed_fee | number | Fixed fee, premium feature | |||||||||||||||||||||
id | integer | Project ID | |||||||||||||||||||||
is_private | boolean | Whether the project is private | |||||||||||||||||||||
name | string | Name | |||||||||||||||||||||
rate | number | Hourly rate | |||||||||||||||||||||
rate_last_updated | string | null | Last date for rate change | |||||||||||||||||||||
recurring | boolean | Whether the project is recurring, premium feature | |||||||||||||||||||||
recurring_parameters | Array of
| Project recurring parameters, premium feature | |||||||||||||||||||||
server_deleted_at | string | null | Deletion date | |||||||||||||||||||||
start_date | string | Start date | |||||||||||||||||||||
status | string | Status of the project (upcoming, active, ended, archived, deleted) | |||||||||||||||||||||
template | boolean | null | Whether the project is used as template, premium feature | |||||||||||||||||||||
wid | integer | Workspace ID legacy field | |||||||||||||||||||||
workspace_id | integer | Workspace ID |
403​
User does not have access to this resource.
500​
Internal Server Error
PUT WorkspaceProject​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}
Update project for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id} \
-H "Content-Type: application/json" \
-d '{"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}", {
method: "PUT",
body: {"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}', json='{"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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}/projects/{project_id}".to_string())
.json(&serde_json::json!({"active":"boolean","auto_estimates":"boolean","billable":"boolean","cid":"integer","client_id":"integer","client_name":"string","color":"string","currency":"string","end_date":"string","estimated_hours":"integer","fixed_fee":"number","is_private":"boolean","name":"string","rate":"number","rate_change_mode":"string","recurring":"boolean","recurring_parameters":{"custom_period":"integer","period":"string","project_start_date":"string"},"start_date":"string","template":"boolean","template_id":"integer"}))
.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 |
project_id | integer | true | Numeric ID of the project |
Body​
name | type | description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
active | boolean | Whether the project is active or archived | ||||||||||||
auto_estimates | boolean | Whether estimates are based on task hours, optional, premium feature | ||||||||||||
billable | boolean | Whether the project is set as billable, optional, premium feature | ||||||||||||
cid | integer | Client ID, legacy | ||||||||||||
client_id | integer | Client ID, optional | ||||||||||||
client_name | string | Client name, optional | ||||||||||||
color | string | Project color | ||||||||||||
currency | string | Project currency, optional, premium feature | ||||||||||||
end_date | string | End date of a project timeframe | ||||||||||||
estimated_hours | integer | Estimated hours, optional, premium feature | ||||||||||||
fixed_fee | number | Project fixed fee, optional, premium feature | ||||||||||||
is_private | boolean | Whether the project is private or not | ||||||||||||
name | string | Project name | ||||||||||||
rate | number | Hourly rate, optional, premium feature | ||||||||||||
rate_change_mode | string | Rate change mode, optional, premium feature. Can be "start-today", "override-current", "override-all" | ||||||||||||
recurring | boolean | Project is recurring, optional, premium feature | ||||||||||||
recurring_parameters |
| Project recurring parameters, optional, premium feature | ||||||||||||
start_date | string | Start date of a project timeframe | ||||||||||||
template | boolean | Project is template, optional, premium feature | ||||||||||||
template_id | integer | Template ID, optional |
Response​
200​
name | type | description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
active | boolean | Whether the project is active or archived | |||||||||||||||||||||
actual_hours | integer | null | Actual hours | |||||||||||||||||||||
actual_seconds | integer | null | Actual seconds | |||||||||||||||||||||
at | string | Last updated date | |||||||||||||||||||||
auto_estimates | boolean | null | Whether estimates are based on task hours, premium feature | |||||||||||||||||||||
billable | boolean | null | Whether the project is billable, premium feature | |||||||||||||||||||||
cid | integer | Client ID legacy field | |||||||||||||||||||||
client_id | integer | null | Client ID | |||||||||||||||||||||
color | string | Color | |||||||||||||||||||||
created_at | string | Creation date | |||||||||||||||||||||
currency | string | null | Currency, premium feature | |||||||||||||||||||||
current_period |
| Current project period, premium feature | |||||||||||||||||||||
end_date | string | End date | |||||||||||||||||||||
estimated_hours | integer | null | Estimated hours | |||||||||||||||||||||
estimated_seconds | integer | null | Estimated seconds | |||||||||||||||||||||
first_time_entry | string | First time entry for this project. Only included if it was requested with with_first_time_entry | |||||||||||||||||||||
fixed_fee | number | Fixed fee, premium feature | |||||||||||||||||||||
id | integer | Project ID | |||||||||||||||||||||
is_private | boolean | Whether the project is private | |||||||||||||||||||||
name | string | Name | |||||||||||||||||||||
rate | number | Hourly rate | |||||||||||||||||||||
rate_last_updated | string | null | Last date for rate change | |||||||||||||||||||||
recurring | boolean | Whether the project is recurring, premium feature | |||||||||||||||||||||
recurring_parameters | Array of
| Project recurring parameters, premium feature | |||||||||||||||||||||
server_deleted_at | string | null | Deletion date | |||||||||||||||||||||
start_date | string | Start date | |||||||||||||||||||||
status | string | Status of the project (upcoming, active, ended, archived, deleted) | |||||||||||||||||||||
template | boolean | null | Whether the project is used as template, premium feature | |||||||||||||||||||||
wid | integer | Workspace ID legacy field | |||||||||||||||||||||
workspace_id | integer | Workspace ID |
400​
Possible errors:
* Client with the ID {client ID} isn't present in workspace {workspace ID}
* Error in validating color '{color}'. Project color must be a hex value in the form of #\[0-9a-f\]{6}.
403​
User does not have access to this resource.
500​
Internal Server Error
DELETE WorkspaceProject​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}
Delete project for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.delete('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::DELETE, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}".to_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 |
project_id | integer | true | Numeric ID of the project |
Query​
name | type | required | description |
---|---|---|---|
teDeletionMode | string | false | Time entries deletion mode: 'delete' or 'unassign' |
Response​
200​
Successful operation.
403​
User does not have access to this resource.
500​
Internal Server Error