Tasks
GET WorkspaceProjectTasks
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks
Get project tasks for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks \
-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}/tasks")
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}/tasks')
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}/tasks", {
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}/tasks', 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}/tasks".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 |
Response
200
Name | Type | Description |
---|---|---|
active | boolean | False when the task has been done |
at | string | When the task was created/last modified |
client_name | string | null |
estimated_seconds | integer | null |
id | integer | Task ID |
integration_ext_id | string | The external ID of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_ext_type | string | The external type of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_provider | string | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
name | string | Task Name |
permissions | string | - |
project_billable | boolean | - |
project_color | string | Metadata |
project_id | integer | Project ID |
project_name | string | - |
rate | number | Rate for this task |
rate_last_updated | string | null |
recurring | boolean | Whether this is a recurring task |
toggl_accounts_id | string | null |
tracked_seconds | integer | The value tracked_seconds is in milliseconds, not in seconds. |
user_id | integer | null |
workspace_id | integer | Workspace ID |
400
Possible errors:
- Invalid project_id
403
User does not have access to this resource.
500
Internal Server Error
POST WorkspaceProjectTasks
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks
Post project tasks for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks \
-H "Content-Type: application/json" \
-d '\{"active":"boolean","estimated_seconds":"integer","name":"string","user_id":"integer"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"active":"boolean","estimated_seconds":"integer","name":"string","user_id":"integer"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks", 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}/tasks')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"active":"boolean","estimated_seconds":"integer","name":"string","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}/projects/{project_id}/tasks", {
method: "POST",
body: \{"active":"boolean","estimated_seconds":"integer","name":"string","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}/projects/{project_id}/tasks', json=\{"active":"boolean","estimated_seconds":"integer","name":"string","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}/projects/{project_id}/tasks".to_string())
.json(&serde_json::json!(\{"active":"boolean","estimated_seconds":"integer","name":"string","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 |
project_id | integer | true | Numeric ID of the project |
Body
Name | Type | Description |
---|---|---|
active | boolean | Use false to mark the task as done |
estimated_seconds | integer | Task estimation in seconds |
name | string | Name |
user_id | integer | Creator ID, if omitted, will use requester user ID |
Response
200
Name | Type | Description |
---|---|---|
active | boolean | False when the task has been done |
at | string | When the task was created/last modified |
client_name | string | null |
estimated_seconds | integer | null |
id | integer | Task ID |
integration_ext_id | string | The external ID of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_ext_type | string | The external type of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_provider | string | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
name | string | Task Name |
permissions | string | - |
project_billable | boolean | - |
project_color | string | Metadata |
project_id | integer | Project ID |
project_name | string | - |
rate | number | Rate for this task |
rate_last_updated | string | null |
recurring | boolean | Whether this is a recurring task |
toggl_accounts_id | string | null |
tracked_seconds | integer | The value tracked_seconds is in milliseconds, not in seconds. |
user_id | integer | null |
workspace_id | integer | Workspace ID |
400
Possible errors:
- "Project not found/accessible, Can not change tasks of archived project"
- Invalid project_id
403
User does not have access to this resource.
500
Internal Server Error
PATCH WorkspaceProjectTasks
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_ids}
Patch project tasks for given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_ids} \
-H "Content-Type: application/json" \
-d '[\{"op":"string","path":"string"\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"op":"string","path":"string"\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_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_id}/tasks/{task_ids}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Patch.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{"op":"string","path":"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}/projects/{project_id}/tasks/{task_ids}", {
method: "PATCH",
body: [\{"op":"string","path":"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.patch('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_ids}', json=[\{"op":"string","path":"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::PATCH, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_ids}".to_string())
.json(&serde_json::json!([\{"op":"string","path":"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 |
task_ids | string | true | Numeric IDs of project tasks separated by comma |
Body
Name | Type | Description |
---|---|---|
items | Array of object | - |
items
Name | Type | Description |
---|---|---|
op | string | - |
path | string | - |
Response
200
Name | Type | Description |
---|---|---|
failure | Array of object | - |
success | Array of integer | - |
failure
Name | Type | Description |
---|---|---|
id | integer | - |
message | string | - |
400
Possible errors:
- Invalid project_id
403
User does not have access to this resource.
500
Internal Server Error
GET WorkspaceProjectTask
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_id}
Get project task for given task id.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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 |
task_id | integer | true | Numeric ID of the task |
Response
200
Name | Type | Description |
---|---|---|
active | boolean | False when the task has been done |
at | string | When the task was created/last modified |
client_name | string | null |
estimated_seconds | integer | null |
id | integer | Task ID |
integration_ext_id | string | The external ID of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_ext_type | string | The external type of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_provider | string | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
name | string | Task Name |
permissions | string | - |
project_billable | boolean | - |
project_color | string | Metadata |
project_id | integer | Project ID |
project_name | string | - |
rate | number | Rate for this task |
rate_last_updated | string | null |
recurring | boolean | Whether this is a recurring task |
toggl_accounts_id | string | null |
tracked_seconds | integer | The value tracked_seconds is in milliseconds, not in seconds. |
user_id | integer | null |
workspace_id | integer | Workspace ID |
400
Possible errors:
- Invalid project_id
- Invalid task_id
403
User does not have access to this resource.
500
Internal Server Error
PUT WorkspaceProjectTask
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_id}
Put project task 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}/tasks/{task_id} \
-H "Content-Type: application/json" \
-d '\{"active":"boolean","estimated_seconds":"integer","name":"string","user_id":"integer"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"active":"boolean","estimated_seconds":"integer","name":"string","user_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}/tasks/{task_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}/tasks/{task_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","estimated_seconds":"integer","name":"string","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}/projects/{project_id}/tasks/{task_id}", {
method: "PUT",
body: \{"active":"boolean","estimated_seconds":"integer","name":"string","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.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_id}', json=\{"active":"boolean","estimated_seconds":"integer","name":"string","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::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_id}".to_string())
.json(&serde_json::json!(\{"active":"boolean","estimated_seconds":"integer","name":"string","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 |
project_id | integer | true | Numeric ID of the project |
task_id | string | true | Numeric ID of project task |
Body
Name | Type | Description |
---|---|---|
active | boolean | Use false to mark the task as done |
estimated_seconds | integer | Task estimation in seconds |
name | string | Name |
user_id | integer | Creator ID, if omitted, will use requester user ID |
Response
200
Name | Type | Description |
---|---|---|
active | boolean | False when the task has been done |
at | string | When the task was created/last modified |
client_name | string | null |
estimated_seconds | integer | null |
id | integer | Task ID |
integration_ext_id | string | The external ID of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_ext_type | string | The external type of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_provider | string | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
name | string | Task Name |
permissions | string | - |
project_billable | boolean | - |
project_color | string | Metadata |
project_id | integer | Project ID |
project_name | string | - |
rate | number | Rate for this task |
rate_last_updated | string | null |
recurring | boolean | Whether this is a recurring task |
toggl_accounts_id | string | null |
tracked_seconds | integer | The value tracked_seconds is in milliseconds, not in seconds. |
user_id | integer | null |
workspace_id | integer | Workspace ID |
400
Possible errors:
- Invalid project_id
- Invalid task_id
403
User does not have access to this resource.
500
Internal Server Error
DELETE WorkspaceProjectTask
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/projects/{project_id}/tasks/{task_id}
Delete projects task 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}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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}/tasks/{task_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 |
task_id | integer | true | Numeric ID of the task |
Response
200
Successful operation.
400
Possible errors:
- Invalid project_id
- Invalid task_id
403
User does not have access to this resource.
500
Internal Server Error
GET Tasks
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tasks
List Workspace tasks.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tasks \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tasks")
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}/tasks')
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}/tasks", {
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}/tasks', 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}/tasks".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 |
---|---|---|---|
since | integer | false | Retrieve tasks created/modified/deleted since this date using UNIX timestamp. |
page | integer | false | Page number, default 1 |
per_page | integer | false | Number of items per page, default 50 |
sort_order | string | false | Sort order, default ASC |
sort_field | string | false | Field used for sorting. Default is name. Valid values are 'name' and 'created_at' |
active | boolean | false | Filter by active state. You can also pass 'both' to get both active and inactive tasks. |
pid | integer | false | Filter by project id |
start_date | string | false | Smallest boundary date in the format YYYY-MM-DD |
end_date | string | false | Biggest boundary date in the format YYYY-MM-DD |
Response
200
Name | Type | Description |
---|---|---|
data | Array of object | - |
page | integer | - |
per_page | integer | - |
sort_field | string | - |
sort_order | string | - |
total_count | integer | - |
data
Name | Type | Description |
---|---|---|
active | boolean | False when the task has been done |
at | string | When the task was created/last modified |
client_name | string | null |
estimated_seconds | integer | null |
id | integer | Task ID |
integration_ext_id | string | The external ID of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_ext_type | string | The external type of the linked entity in the external system (e.g. JIRA/SalesForce) |
integration_provider | string | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
name | string | Task Name |
permissions | string | - |
project_billable | boolean | - |
project_color | string | Metadata |
project_id | integer | Project ID |
project_name | string | - |
rate | number | Rate for this task |
rate_last_updated | string | null |
recurring | boolean | Whether this is a recurring task |
toggl_accounts_id | string | null |
tracked_seconds | integer | The value tracked_seconds is in milliseconds, not in seconds. |
user_id | integer | null |
workspace_id | integer | Workspace ID |
403
User does not have access to this resource.
500
Internal Server Error