Me
GET Me
https://api.track.toggl.com/api/v9/me
Returns details for the current user.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me")
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/me')
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/me", {
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/me', 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/me".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Query
| name | type | required | description |
|---|---|---|---|
| with_related_data | boolean | false | Retrieve user related data (clients, projects, tasks, tags, workspaces, time entries, etc.) |
Response
200
| Name | Type | Description |
|---|---|---|
| 2fa_enabled | boolean | - |
| api_token | string | will be omitted if empty |
| at | string | - |
| authorization_updated_at | string | AuthorizationUpdatedAt timestamp when the authorization user session object was last updated. |
| beginning_of_week | integer | - |
| clients | Array of object | Clients, null if with_related_data was not set to true or if the user does not have any clients |
| country_id | integer | - |
| created_at | string | - |
| default_workspace_id | integer | - |
| string | - | |
| fullname | string | - |
| has_password | boolean | - |
| id | integer | - |
| image_url | string | - |
| intercom_hash | string | will be omitted if empty |
| oauth_providers | Array of string | - |
| openid_email | string | - |
| openid_enabled | boolean | - |
| options | object | will be omitted if empty |
| projects | Array of object | Projects, null if with_related_data was not set to true or if the user does not have any projects |
| tags | Array of object | Tags, null if with_related_data was not set to true, or if the user does not have any tags |
| tasks | Array of object | Tasks, null if with_related_data was not set to true or if the user does not have any tasks |
| time_entries | Array of object | TimeEntries, null if with_related_data was not set to true or if the user does not have any time entries |
| timezone | string | - |
| updated_at | string | - |
| workspaces | Array of object | Workspaces, null if with_related_data was not set to true or if the user does not have any workspaces |
clients
| Name | Type | Description |
|---|---|---|
| archived | boolean | IsArchived is true if the client is archived |
| at | string | When was the last update |
| creator_id | integer | CreatorID is the ID of the user who created the client |
| external_reference | string | ExternalReference can be used to store an external reference to the Track Client entity. |
| id | integer | Client 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 | object | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
| name | string | Name of the client |
| notes | string | - |
| permissions | Array of string | List of authorization permissions for this client. |
| total_count | integer | Total field to store the total count |
| wid | integer | Workspace ID |
projects
| Name | Type | Description |
|---|---|---|
| active | boolean | Whether the project is active or archived |
| actual_hours | integer | null |
| actual_seconds | integer | null |
| at | string | Last updated date |
| auto_estimates | boolean | null |
| billable | boolean | null |
| can_track_time | boolean | - |
| cid | integer | Client ID legacy field |
| client_id | integer | null |
| client_name | string | - |
| color | string | Color |
| created_at | string | Creation date |
| currency | string | null |
| current_period | object | Current project period, premium feature |
| end_date | string | End date |
| estimated_hours | integer | null |
| estimated_seconds | integer | null |
| external_reference | string | ExternalReference can be used to store an external reference to the Track Project Entity. |
| fixed_fee | number | Fixed fee, premium feature |
| id | integer | Project 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 | object | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
| is_private | boolean | Whether the project is private |
| name | string | Name |
| permissions | Array of string | - |
| pinned | boolean | - |
| rate | number | Hourly rate |
| rate_last_updated | string | null |
| recurring | boolean | Whether the project is recurring, premium feature |
| recurring_parameters | Array of object | Project recurring parameters, premium feature |
| start_date | string | Start date |
| status | object | Status of the project (upcoming, active, ended, archived, deleted) |
| template | boolean | null |
| template_id | integer | null |
| total_count | integer | Total number of projects found |
| wid | integer | Workspace ID legacy field |
| workspace_id | integer | Workspace ID |
recurring_parameters
| Name | Type | Description |
|---|---|---|
| custom_period | integer | Custom period, used when "period" field is "custom" |
| estimated_seconds | integer | Estimated seconds |
| parameter_end_date | string | null |
| parameter_start_date | string | Recurring start date |
| period | string | Period |
| project_start_date | string | Project start date |
tags
| Name | Type | Description |
|---|---|---|
| at | string | When was created/last modified |
| creator_id | integer | CreatorID the user who created the tag |
| deleted_at | string | When was deleted |
| id | integer | Tag 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 | object | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
| name | string | Tag name |
| permissions | Array of string | - |
| workspace_id | integer | Workspace ID |
tasks
| Name | Type | Description |
|---|---|---|
| active | boolean | False when the task has been done |
| at | string | When the task was created/last modified |
| avatar_url | string | null |
| client_id | integer | null |
| client_name | string | null |
| estimated_seconds | integer | null |
| external_reference | string | ExternalReference can be used to store an external reference to the Track Task Entity. |
| 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 | object | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
| name | string | Task Name |
| permissions | Array of string | - |
| project_billable | boolean | - |
| project_color | string | Metadata |
| project_id | integer | Project ID |
| project_is_private | boolean | null |
| 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 |
| user_name | string | null |
| workspace_id | integer | Workspace ID |
time_entries
| Name | Type | Description |
|---|---|---|
| at | string | When was last updated, the field follows the ISO 8601 format (HH:mm:ss.ssssssZ) |
| billable | boolean | Whether the time entry is marked as billable |
| client_id | integer | Related entities meta fields - if requested |
| client_name | string | - |
| 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. |
| expense_ids | Array of integer | Work expenses |
| 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 | - |
workspaces
| Name | Type | Description |
|---|---|---|
| admin | boolean | Current user is workspace admin Deprecated |
| api_token | string | deprecated |
| at | string | Timestamp of last workspace change |
| business_ws | boolean | Workspace on Premium subscription |
| csv_upload | object | CSV upload data |
| default_currency | string | Default currency, premium feature, optional, only for existing WS, will be 'USD' initially |
| default_hourly_rate | number | The default hourly rate, premium feature, optional, only for existing WS, will be 0.0 initially |
| disable_approvals | boolean | Disable approvals in the workspace |
| disable_expenses | boolean | Disable expenses in the workspace |
| disable_timesheet_view | boolean | Disable timesheet view in the workspace |
| hide_start_end_times | boolean | - |
| ical_enabled | boolean | Calendar integration enabled |
| ical_url | string | URL of calendar |
| id | integer | Identifier of the workspace |
| last_modified | string | Last modification of data in the workspace |
| limit_public_project_data | boolean | Limit public projects data in reports to admins. |
| logo_url | string | URL of workspace logo |
| max_data_retention_days | object | How far back free workspaces can access data. |
| name | string | Name of the workspace |
| only_admins_may_create_projects | boolean | Only admins will be able to create projects, optional, only for existing WS, will be false initially |
| only_admins_may_create_tags | boolean | Only admins will be able to create tags, optional, only for existing WS, will be false initially |
| only_admins_see_team_dashboard | boolean | Only admins will be able to see the team dashboard, optional, only for existing WS, will be false initially |
| organization_id | integer | Identifier of the organization |
| permissions | Array of string | Permissions list |
| premium | boolean | Workspace on Starter subscription |
| projects_billable_by_default | boolean | New projects billable by default |
| projects_enforce_billable | boolean | Whether tracking time to projects will enforce billable setting to be respected. |
| projects_private_by_default | boolean | Workspace setting for default project visbility. |
| rate_last_updated | string | Timestamp of last workspace rate update |
| reports_collapse | boolean | Whether reports should be collapsed by default, optional, only for existing WS, will be true initially |
| role | string | Role of the current user in the workspace |
| rounding | integer | Default rounding, premium feature, optional, only for existing WS. 0 - nearest, 1 - round up, -1 - round down |
| rounding_minutes | integer | Default rounding in minutes, premium feature, optional, only for existing WS |
| subscription | object | deprecated |
| suspended_at | string | Timestamp of suspension |
| te_constraints | object | Time entry constraints setting |
| working_hours_in_minutes | integer | Working hours in minutes |
403
User does not have access to this resource.
404
could not load user data
500
Internal Server Error
PUT Me
https://api.track.toggl.com/api/v9/me
Updates details for the current user.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/me \
-H "Content-Type: application/json" \
-d '\{"beginning_of_week":"integer","country_id":"integer","current_password":"string","default_workspace_id":"integer","email":"string","fullname":"string","password":"string","timezone":"string"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"beginning_of_week":"integer","country_id":"integer","current_password":"string","default_workspace_id":"integer","email":"string","fullname":"string","password":"string","timezone":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/me", 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/me')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"beginning_of_week":"integer","country_id":"integer","current_password":"string","default_workspace_id":"integer","email":"string","fullname":"string","password":"string","timezone":"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/me", {
method: "PUT",
body: \{"beginning_of_week":"integer","country_id":"integer","current_password":"string","default_workspace_id":"integer","email":"string","fullname":"string","password":"string","timezone":"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/me', json=\{"beginning_of_week":"integer","country_id":"integer","current_password":"string","default_workspace_id":"integer","email":"string","fullname":"string","password":"string","timezone":"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/me".to_string())
.json(&serde_json::json!(\{"beginning_of_week":"integer","country_id":"integer","current_password":"string","default_workspace_id":"integer","email":"string","fullname":"string","password":"string","timezone":"string"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Body
| Name | Type | Description |
|---|---|---|
| beginning_of_week | integer | User's first day of the week. Sunday: 0, Monday:1, etc. |
| country_id | integer | User's country ID |
| current_password | string | User's current password (used to change the current password) |
| default_workspace_id | integer | User's default workspace ID |
| string | User's email address | |
| fullname | string | User's full name |
| password | string | User's new password (current one must also be provided) |
| timezone | string | User's timezone |
Response
200
| Name | Type | Description |
|---|---|---|
| 2fa_enabled | boolean | - |
| api_token | string | will be omitted if empty |
| at | string | - |
| beginning_of_week | integer | - |
| country_id | integer | - |
| created_at | string | - |
| default_workspace_id | integer | - |
| string | - | |
| fullname | string | - |
| has_password | boolean | - |
| id | integer | - |
| image_url | string | - |
| openid_email | string | - |
| openid_enabled | boolean | - |
| options | object | will be omitted if empty |
| timezone | string | - |
| updated_at | string | - |
400
Possible error messages:
- Current password is not valid
- Current password must be present to change password
- Invalid beginning_of_week
- Invalid country_id
- Invalid default_workspace_id
- Invalid email
- Invalid fullname
- Invalid timezone
- Password should be at least 6 characters
- user with this email already exists
403
User does not have access to this resource.
GET Clients
https://api.track.toggl.com/api/v9/me/clients
Get Clients.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me/clients \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me/clients")
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/me/clients')
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/me/clients", {
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/me/clients', 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/me/clients".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Query
| name | type | required | description |
|---|---|---|---|
| since | integer | false | Retrieve clients created/modified/deleted since this date using UNIX timestamp. |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| archived | boolean | IsArchived is true if the client is archived |
| at | string | When was the last update |
| creator_id | integer | CreatorID is the ID of the user who created the client |
| external_reference | string | ExternalReference can be used to store an external reference to the Track Client entity. |
| id | integer | Client 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 | object | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
| name | string | Name of the client |
| notes | string | - |
| permissions | Array of string | List of authorization permissions for this client. |
| total_count | integer | Total field to store the total count |
| wid | integer | Workspace ID |
500
Internal Server Error
GET Features
https://api.track.toggl.com/api/v9/me/features
Get features.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me/features \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me/features")
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/me/features')
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/me/features", {
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/me/features', 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/me/features".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| features | Array of object | - |
| workspace_id | integer | - |
features
| Name | Type | Description |
|---|---|---|
| enabled | boolean | - |
| feature_id | integer | - |
| name | string | - |
403
Operation Forbidden
500
Internal Server Error
GET User's last known location
https://api.track.toggl.com/api/v9/me/location
Returns the client's IP-based location. If no data is present, empty response will be yielded.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me/location \
-H "Content-Type: application/json"
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me/location")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
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/me/location')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/me/location", {
method: "GET",
headers: {
"Content-Type": "application/json"
},
})
.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/me/location', headers={'content-type': 'application/json'})
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();
let json = client.request(Method::GET, "https://api.track.toggl.com/api/v9/me/location".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
| Name | Type | Description |
|---|---|---|
| city | string | - |
| city_lat_long | string | - |
| country_code | string | - |
| country_name | string | - |
| state | string | - |
404
Country with given ISO code not found
500
Internal Server Error
GET Logged
https://api.track.toggl.com/api/v9/me/logged
Used to check if authentication works.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me/logged \
-H "Content-Type: application/json"
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me/logged")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
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/me/logged')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/me/logged", {
method: "GET",
headers: {
"Content-Type": "application/json"
},
})
.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/me/logged', headers={'content-type': 'application/json'})
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();
let json = client.request(Method::GET, "https://api.track.toggl.com/api/v9/me/logged".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
OK
500
Internal Server Error
GET Organizations that a user is part of
https://api.track.toggl.com/api/v9/me/organizations
Get all organizations a given user is part of.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me/organizations \
-H "Content-Type: application/json"
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me/organizations")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
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/me/organizations')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/me/organizations", {
method: "GET",
headers: {
"Content-Type": "application/json"
},
})
.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/me/organizations', headers={'content-type': 'application/json'})
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();
let json = client.request(Method::GET, "https://api.track.toggl.com/api/v9/me/organizations".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| admin | boolean | Whether the requester is an admin of the organization |
| at | string | Organization's last modification date |
| created_at | string | Organization's creation date |
| id | integer | Organization ID |
| is_multi_workspace_enabled | boolean | Is true when the organization option is_multi_workspace_enabled is set |
| is_unified | boolean | Deprecated: use Subscription instead; all orgs with an active subscription are unified. |
| max_data_retention_days | object | How far back free workspaces in this org can access data. |
| max_workspaces | integer | Maximum number of workspaces allowed for the organization |
| name | string | Organization Name |
| owner | boolean | Whether the requester is a the owner of the organization |
| permissions | Array of string | - |
| pricing_plan_enterprise | boolean | Deprecated: use Subscription.Enterprise instead. |
| pricing_plan_id | integer | Deprecated: use Subscription.Plan instead. |
| pricing_plan_name | string | Deprecated: use Subscription.PlanName instead. |
| subscription | object | - |
| suspended_at | string | Whether the organization is currently suspended |
| trial_info | object | Deprecated: use Subscription.Trial instead. |
| user_count | integer | Number of organization users |
subscription
| Name | Type | Description |
|---|---|---|
| billing_period_months | integer | Billing period in months (1 = monthly, 12 = yearly, 0 for free) |
| cancel_date | string | null |
| created_at | string | null |
| current_period_ends_at | string | null |
| current_period_starts_at | string | null |
| enterprise | boolean | Whether this is an enterprise plan |
| plan | object | The product handle (e.g. "free", "starter", "premium", "enterprise") |
| plan_name | string | Human-readable plan name (e.g. "Free", "Starter", "Premium") |
| seats | integer | null |
| state | object | Subscription state (e.g. "free", "active", "trialing", "past_due", "canceled") |
| trial | object | Trial information |
500
Internal Server Error
GET Projects
https://api.track.toggl.com/api/v9/me/projects
Get projects
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me/projects \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me/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/me/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/me/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/me/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/me/projects".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Query
| name | type | required | description |
|---|---|---|---|
| include_archived | string | false | Include archived projects. |
| since | integer | false | Retrieve projects modified since this date using UNIX timestamp, including deleted ones. |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| active | boolean | Whether the project is active or archived |
| actual_hours | integer | null |
| actual_seconds | integer | null |
| at | string | Last updated date |
| auto_estimates | boolean | null |
| billable | boolean | null |
| can_track_time | boolean | - |
| cid | integer | Client ID legacy field |
| client_id | integer | null |
| client_name | string | - |
| color | string | Color |
| created_at | string | Creation date |
| currency | string | null |
| current_period | object | Current project period, premium feature |
| end_date | string | End date |
| estimated_hours | integer | null |
| estimated_seconds | integer | null |
| external_reference | string | ExternalReference can be used to store an external reference to the Track Project Entity. |
| fixed_fee | number | Fixed fee, premium feature |
| id | integer | Project 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 | object | The provider (e.g. JIRA/SalesForce) that has an entity linked to this Toggl Track entity |
| is_private | boolean | Whether the project is private |
| name | string | Name |
| permissions | Array of string | - |
| pinned | boolean | - |
| rate | number | Hourly rate |
| rate_last_updated | string | null |
| recurring | boolean | Whether the project is recurring, premium feature |
| recurring_parameters | Array of object | Project recurring parameters, premium feature |
| start_date | string | Start date |
| status | object | Status of the project (upcoming, active, ended, archived, deleted) |
| template | boolean | null |
| template_id | integer | null |
| total_count | integer | Total number of projects found |
| wid | integer | Workspace ID legacy field |
| workspace_id | integer | Workspace ID |
recurring_parameters
| Name | Type | Description |
|---|---|---|
| custom_period | integer | Custom period, used when "period" field is "custom" |
| estimated_seconds | integer | Estimated seconds |
| parameter_end_date | string | null |
| parameter_start_date | string | Recurring start date |
| period | string | Period |
| project_start_date | string | Project start date |
400
Invalid include_archived
403
Operation Forbidden
500
Internal Server Error
GET ProjectsPaginated
https://api.track.toggl.com/api/v9/me/projects/paginated
Get paginated projects.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/me/projects/paginated \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/me/projects/paginated")
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/me/projects/paginated')
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/me/projects/paginated", {
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/me/projects/paginated', 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/me/projects/paginated".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Query
| name | type | required | description |
|---|---|---|---|
| start_project_id | integer | false | Project ID to resume the next pagination from. |
| since | integer | false | Retrieve projects created/modified/deleted since this date using UNIX timestamp. |
| per_page | integer | false | Number of items per page, default 201. |