Projects
GET List projects
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects
Returns a list of projects based on the provided workspace ID and filter params.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
Query
| name | type | required | description |
|---|---|---|---|
| page | integer | false | page number |
| per_page | integer | false | results per page |
| order_by | []string | false | order by |
| pinned | boolean | false | filter by only pinned tasks |
| archived | boolean | false | filter by archived state (true = archived only, false = active only, omit = active only, empty = all projects) |
| private | boolean | false | filter by project privacy (true for private, false for public) |
| name | string | false | filter by project name |
| client_id | []integer | false | filter by client IDs |
| creator_id | []integer | false | filter by project creator id |
| tag_id | []integer | false | filter by tag IDs |
| project_id | []integer | false | filter by project IDs |
| user_id | []integer | false | return only projects accessible by the given users (requires manage workspace users when inspecting another user) |
| include_rates | boolean | false | includes the projects' rate data |
| start_date | string | false | filter projects overlapping date range (start). Used with end_date to find projects where project.start_date <= end_date AND project.end_date >= start_date |
| end_date | string | false | filter projects overlapping date range (end). Used with start_date to find projects where project.start_date <= end_date AND project.end_date >= start_date |
| date_overlap_start | string | false | [LEGACY] use start_date instead |
| date_overlap_end | string | false | [LEGACY] use end_date instead |
Response
200
| Name | Type | Description |
|---|---|---|
| data | Array of object | - |
| page | integer | - |
| per_page | integer | - |
| total | integer | - |
data
| Name | Type | Description |
|---|---|---|
| active | boolean | - |
| archived_at | string | - |
| auto_compute_estimates | boolean | - |
| billable | boolean | - |
| client | object | - |
| client_id | integer | - |
| color | string | - |
| created_at | string | - |
| deleted_at | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| fixed_fee | object | - |
| id | integer | - |
| name | string | - |
| parent_project_id | integer | - |
| permissions | Array of string | - |
| pinned | boolean | - |
| private | boolean | - |
| rate | object | - |
| start_date | string | - |
| tag_ids | Array of integer | - |
| tags | Array of object | - |
| task_estimated_mins | integer | - |
| toggl_user_id | integer | - |
| total_tracked_time | integer | - |
| updated_at | string | - |
| workspace_id | integer | - |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
fixed_fee
| Name | Type | Description |
|---|---|---|
| amount | number | - |
| currency | string | - |
rate
| Name | Type | Description |
|---|---|---|
| billable | boolean | - |
| currency | string | - |
| end_at | string | - |
| has_more_rates | boolean | - |
| hourly_rate | number | - |
| project_color | string | - |
| project_created_at | string | - |
| project_id | integer | - |
| project_name | string | - |
| project_rate_id | integer | - |
| start_at | string | - |
| workspace_rate_id | integer | - |
tags
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
400
Invalid request
500
Internal Server Error
POST Create a new project
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects
Creates a new project with the provided name, workspace ID, parent project ID, and client ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects \
-H "Content-Type: application/json" \
-d '\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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 = \{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects", {
method: "POST",
body: \{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\},
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects', json=\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_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::POST, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects".to_string())
.json(&serde_json::json!(\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
Body
| Name | Type | Description |
|---|---|---|
| auto_compute_estimates | boolean | - |
| billable | boolean | - |
| client_id | integer | - |
| color | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| fixed_fee | object | - |
| name | string | - |
| parent_project_id | integer | - |
| pinned | boolean | - |
| private | boolean | - |
| start_date | string | - |
| tag_ids | Array of integer | - |
fixed_fee
| Name | Type | Description |
|---|---|---|
| amount | number | - |
| currency | string | - |
Response
201
Project created successfully
400
Invalid project parameters
500
Internal Server Error
GET Get a project by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}
Returns a project by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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 |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
200
| Name | Type | Description |
|---|---|---|
| active | boolean | - |
| archived_at | string | - |
| auto_compute_estimates | boolean | - |
| billable | boolean | - |
| client | object | - |
| client_id | integer | - |
| color | string | - |
| created_at | string | - |
| deleted_at | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| fixed_fee | object | - |
| id | integer | - |
| name | string | - |
| parent_project_id | integer | - |
| permissions | Array of string | - |
| pinned | boolean | - |
| private | boolean | - |
| rate | object | - |
| start_date | string | - |
| tag_ids | Array of integer | - |
| tags | Array of object | - |
| task_estimated_mins | integer | - |
| toggl_user_id | integer | - |
| total_tracked_time | integer | - |
| updated_at | string | - |
| workspace_id | integer | - |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
fixed_fee
| Name | Type | Description |
|---|---|---|
| amount | number | - |
| currency | string | - |
rate
| Name | Type | Description |
|---|---|---|
| billable | boolean | - |
| currency | string | - |
| end_at | string | - |
| has_more_rates | boolean | - |
| hourly_rate | number | - |
| project_color | string | - |
| project_created_at | string | - |
| project_id | integer | - |
| project_name | string | - |
| project_rate_id | integer | - |
| start_at | string | - |
| workspace_rate_id | integer | - |
tags
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
400
Invalid request
404
Project does not exist
500
Internal Server Error
PUT Update project
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}
Update an existing project
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id} \
-H "Content-Type: application/json" \
-d '\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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 = \{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}", {
method: "PUT",
body: \{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\},
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}', json=\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_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::PUT, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}".to_string())
.json(&serde_json::json!(\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{"amount":"number","currency":"string"\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | Project ID |
Body
| Name | Type | Description |
|---|---|---|
| auto_compute_estimates | boolean | - |
| billable | boolean | - |
| client_id | integer | - |
| color | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| fixed_fee | object | - |
| name | string | - |
| parent_project_id | integer | - |
| pinned | boolean | - |
| private | boolean | - |
| start_date | string | - |
| tag_ids | Array of integer | - |
fixed_fee
| Name | Type | Description |
|---|---|---|
| amount | number | - |
| currency | string | - |
Response
201
Project updated successfully
400
Invalid request
404
Project does not exist
500
Internal Server Error
DELETE Delete a project by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}
Deletes a project by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/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 |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
204
No Content
400
Invalid request
404
Project does not exist
500
Internal Server Error
PATCH Patch project
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}
Partially update an existing project
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id} \
-H "Content-Type: application/json" \
-d '\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Patch.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}", {
method: "PATCH",
body: \{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\},
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}', json=\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}".to_string())
.json(&serde_json::json!(\{"auto_compute_estimates":"boolean","billable":"boolean","client_id":"integer","color":"string","description":"string","end_date":"string","estimated_mins":"integer","fixed_fee":\{\},"name":"string","parent_project_id":"integer","pinned":"boolean","private":"boolean","start_date":"string","tag_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | Project ID |
Body
| Name | Type | Description |
|---|---|---|
| auto_compute_estimates | boolean | - |
| billable | boolean | - |
| client_id | integer | null |
| color | string | null |
| description | string | null |
| end_date | string | null |
| estimated_mins | integer | null |
| fixed_fee | object | - |
| name | string | - |
| parent_project_id | integer | null |
| pinned | boolean | - |
| private | boolean | - |
| start_date | string | null |
| tag_ids | Array of integer | - |
Response
201
Project updated successfully
400
Invalid request
404
Project does not exist
500
Internal Server Error
PATCH Archives a project by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/archive
Archives a project by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/archive \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/archive")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/archive')
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/archive", {
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/archive', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/archive".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
204
No Content
400
Invalid request
404
Project does not exist
500
Internal Server Error
GET Get a project with its children sub-projects by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/children
Returns a project and its children sub-projects by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/children \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/children")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/children')
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/children", {
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/children', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/children".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Query
| name | type | required | description |
|---|---|---|---|
| page | integer | false | page number |
| per_page | integer | false | results per page |
| order_by | []string | false | order by |
Response
200
| Name | Type | Description |
|---|---|---|
| data | Array of object | - |
| page | integer | - |
| per_page | integer | - |
data
| Name | Type | Description |
|---|---|---|
| active | boolean | - |
| archived_at | string | - |
| auto_compute_estimates | boolean | - |
| billable | boolean | - |
| client | object | - |
| client_id | integer | - |
| color | string | - |
| created_at | string | - |
| deleted_at | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| fixed_fee | object | - |
| id | integer | - |
| name | string | - |
| parent_project_id | integer | - |
| permissions | Array of string | - |
| pinned | boolean | - |
| private | boolean | - |
| rate | object | - |
| start_date | string | - |
| tag_ids | Array of integer | - |
| tags | Array of object | - |
| task_estimated_mins | integer | - |
| toggl_user_id | integer | - |
| total_tracked_time | integer | - |
| updated_at | string | - |
| workspace_id | integer | - |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
fixed_fee
| Name | Type | Description |
|---|---|---|
| amount | number | - |
| currency | string | - |
rate
| Name | Type | Description |
|---|---|---|
| billable | boolean | - |
| currency | string | - |
| end_at | string | - |
| has_more_rates | boolean | - |
| hourly_rate | number | - |
| project_color | string | - |
| project_created_at | string | - |
| project_id | integer | - |
| project_name | string | - |
| project_rate_id | integer | - |
| start_at | string | - |
| workspace_rate_id | integer | - |
tags
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
400
Invalid request
404
Project does not exist
500
Internal Server Error
GET List project memmbers
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members
Returns a list of userIDs and groupIDs that are part of the given project.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members')
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members", {
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
200
List of project members
| Name | Type | Description |
|---|---|---|
| group_ids | Array of object | - |
| project_id | integer | - |
| user_ids | Array of object | - |
group_ids
| Name | Type | Description |
|---|---|---|
| group_id | integer | - |
| manager | boolean | null |
user_ids
| Name | Type | Description |
|---|---|---|
| manager | boolean | - |
| user_id | integer | - |
400
Invalid request
403
Forbidden
404
Project not found
500
Internal Server Error
PUT Update project member role
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members
Updates the role of a project member (user or group).
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members \
-H "Content-Type: application/json" \
-d '\{"group_id":"integer","role_id":"integer","user_id":"integer"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"group_id":"integer","role_id":"integer","user_id":"integer"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members", 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"group_id":"integer","role_id":"integer","user_id":"integer"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members", {
method: "PUT",
body: \{"group_id":"integer","role_id":"integer","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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members', json=\{"group_id":"integer","role_id":"integer","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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members".to_string())
.json(&serde_json::json!(\{"group_id":"integer","role_id":"integer","user_id":"integer"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Body
| Name | Type | Description |
|---|---|---|
| group_id | integer | - |
| role_id | integer | - |
| user_id | integer | - |
Response
204
No Content
400
Invalid request
403
Forbidden
404
Project not found
500
Internal Server Error
POST Add project members
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members
Adds users and groups to the given project.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members \
-H "Content-Type: application/json" \
-d '\{"group_ids":[\{\}],"role_id":"integer","user_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"group_ids":[\{\}],"role_id":"integer","user_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members", 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"group_ids":[\{\}],"role_id":"integer","user_ids":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members", {
method: "POST",
body: \{"group_ids":[\{\}],"role_id":"integer","user_ids":[\{\}]\},
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members', json=\{"group_ids":[\{\}],"role_id":"integer","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::POST, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members".to_string())
.json(&serde_json::json!(\{"group_ids":[\{\}],"role_id":"integer","user_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Body
| Name | Type | Description |
|---|---|---|
| group_ids | Array of integer | - |
| role_id | integer | - |
| user_ids | Array of integer | - |
Response
204
No Content
400
Invalid request
403
Forbidden
404
Project not found
500
Internal Server Error
DELETE Remove project member
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members
Removes a single user or group from the given project.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members \
-H "Content-Type: application/json" \
-d '\{"group_id":"integer","user_id":"integer"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"group_id":"integer","user_id":"integer"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members", 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"group_id":"integer","user_id":"integer"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members", {
method: "DELETE",
body: \{"group_id":"integer","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.delete('https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members', json=\{"group_id":"integer","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::DELETE, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/members".to_string())
.json(&serde_json::json!(\{"group_id":"integer","user_id":"integer"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Body
| Name | Type | Description |
|---|---|---|
| group_id | integer | - |
| user_id | integer | - |
Response
204
No Content
400
Invalid request
403
Forbidden
404
Project not found
500
Internal Server Error
GET Get a project with its parent projects by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/parents
Returns a project and its parent projects by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/parents \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/parents")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/parents')
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/parents", {
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/parents', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/parents".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Query
| name | type | required | description |
|---|---|---|---|
| page | integer | false | page number |
| per_page | integer | false | results per page |
| order_by | []string | false | order by |
Response
200
| Name | Type | Description |
|---|---|---|
| data | Array of object | - |
| page | integer | - |
| per_page | integer | - |
data
| Name | Type | Description |
|---|---|---|
| active | boolean | - |
| archived_at | string | - |
| auto_compute_estimates | boolean | - |
| billable | boolean | - |
| client | object | - |
| client_id | integer | - |
| color | string | - |
| created_at | string | - |
| deleted_at | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| fixed_fee | object | - |
| id | integer | - |
| name | string | - |
| parent_project_id | integer | - |
| permissions | Array of string | - |
| pinned | boolean | - |
| private | boolean | - |
| rate | object | - |
| start_date | string | - |
| tag_ids | Array of integer | - |
| tags | Array of object | - |
| toggl_user_id | integer | - |
| updated_at | string | - |
| workspace_id | integer | - |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
fixed_fee
| Name | Type | Description |
|---|---|---|
| amount | number | - |
| currency | string | - |
rate
| Name | Type | Description |
|---|---|---|
| billable | boolean | - |
| currency | string | - |
| end_at | string | - |
| has_more_rates | boolean | - |
| hourly_rate | number | - |
| project_color | string | - |
| project_created_at | string | - |
| project_id | integer | - |
| project_name | string | - |
| project_rate_id | integer | - |
| start_at | string | - |
| workspace_rate_id | integer | - |
tags
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
400
Invalid request
404
Project does not exist
500
Internal Server Error
POST Pin a project by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned
Pins a project by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned", {
method: "POST",
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
204
No Content
400
Invalid request
404
Project does not exist
500
Internal Server Error
DELETE Unpin a project by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned
Unpins a project by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned')
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned", {
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/pinned".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
204
No Content
400
Invalid request
404
Project does not exist
500
Internal Server Error
PATCH Restore a project by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/restore
Restores a project by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/restore \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/restore")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/restore')
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/restore", {
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/restore', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/restore".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
204
No Content
400
Invalid request
404
Project does not exist
500
Internal Server Error
PATCH Unarchive a project by ID
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/unarchive
Unarchives a project by the provided ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/unarchive \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/unarchive")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/unarchive')
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/unarchive", {
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/unarchive', 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/projects/{project_id}/unarchive".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| project_id | integer | true | project ID |
Response
204
No Content
400
Invalid request
404
Project does not exist
500
Internal Server Error