SavedViews
GET List saved views
https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views
Get all saved views for the authenticated user with optional filtering and ordering
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views \
-H "Content-Type: application/json"
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views")
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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views')
req = Net::HTTP::Get.new(uri)
req['Content-Type'] = "application/json"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views", {
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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views', 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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
Query
| name | type | required | description |
|---|---|---|---|
| name | string | false | Filter saved views by name (partial match) |
| type | string | false | Filter saved views by type |
| order_by | string | false | Order by field |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| deleted_at | string | - |
| icon_name | string | - |
| id | integer | - |
| name | string | - |
| params | object | - |
| pinned | boolean | - |
| toggl_user_id | integer | - |
| type | string | Valid values: inbox, archive, board, timeline, project, project.tasks, project.board, project.timeline, projects, reports.summary, reports.detailed, reports.utilization, reports.workload, reports.profitability, reports.time-off, reports.time-accounting. |
| updated_at | string | - |
| workspace_id | integer | - |
params
400
Bad Request
500
Internal Server Error
POST Create a new saved view
https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views
Create a new saved view for the authenticated user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views \
-H "Content-Type: application/json" \
-d '\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}'
bytes, err := json.Marshal('\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views", bytes.NewBuffer(bytes))
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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = "application/json"
req.body = \{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views", {
method: "POST",
body: \{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\},
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.post('https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views', json=\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}, 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::POST, "https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views".to_string())
.json(&serde_json::json!(\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
Body
| Name | Type | Description |
|---|---|---|
| icon_name | string | - |
| name | string | - |
| params | object | - |
| pinned | boolean | - |
| type | string | Valid values: inbox, archive, board, timeline, project, project.tasks, project.board, project.timeline, projects, reports.summary, reports.detailed, reports.utilization, reports.workload, reports.profitability, reports.time-off, reports.time-accounting. |
params
Response
201
Created
400
Bad Request
402
Timeline feature unavailable on the current plan
403
Timeline permission unavailable for the current role or module
500
Internal Server Error
GET Get a saved view
https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}
Retrieve a single saved view by ID for the authenticated user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id} \
-H "Content-Type: application/json"
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}")
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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}')
req = Net::HTTP::Get.new(uri)
req['Content-Type'] = "application/json"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}", {
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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}', 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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
| id | integer | true | Saved view ID |
Response
200
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| deleted_at | string | - |
| icon_name | string | - |
| id | integer | - |
| name | string | - |
| params | object | - |
| pinned | boolean | - |
| toggl_user_id | integer | - |
| type | string | Valid values: inbox, archive, board, timeline, project, project.tasks, project.board, project.timeline, projects, reports.summary, reports.detailed, reports.utilization, reports.workload, reports.profitability, reports.time-off, reports.time-accounting. |
| updated_at | string | - |
| workspace_id | integer | - |
params
404
Not Found
500
Internal Server Error
DELETE Delete a saved view
https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}
Delete an existing saved view for the authenticated user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id} \
-H "Content-Type: application/json"
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}")
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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}')
req = Net::HTTP::Delete.new(uri)
req['Content-Type'] = "application/json"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}", {
method: "DELETE",
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.delete('https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}', 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::DELETE, "https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
| id | integer | true | Saved view ID |
Response
204
No Content
404
Not Found
500
Internal Server Error
PATCH Update a saved view
https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}
Update an existing saved view for the authenticated user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id} \
-H "Content-Type: application/json" \
-d '\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}'
bytes, err := json.Marshal('\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}", bytes.NewBuffer(bytes))
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://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}')
req = Net::HTTP::Patch.new(uri)
req['Content-Type'] = "application/json"
req.body = \{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}", {
method: "PATCH",
body: \{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\},
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.patch('https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}', json=\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}, 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::PATCH, "https://focus.toggl.com/api/workspaces/{workspace_id}/saved-views/{id}".to_string())
.json(&serde_json::json!(\{"icon_name":"string","name":"string","params":\{\},"pinned":"boolean","type":"string"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
| id | integer | true | Saved view ID |
Body
| Name | Type | Description |
|---|---|---|
| icon_name | string | - |
| name | string | - |
| params | object | - |
| pinned | boolean | - |
| type | string | Valid values: inbox, archive, board, timeline, project, project.tasks, project.board, project.timeline, projects, reports.summary, reports.detailed, reports.utilization, reports.workload, reports.profitability, reports.time-off, reports.time-accounting. |
params
Response
200
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| deleted_at | string | - |
| icon_name | string | - |
| id | integer | - |
| name | string | - |
| params | object | - |
| pinned | boolean | - |
| toggl_user_id | integer | - |
| type | string | Valid values: inbox, archive, board, timeline, project, project.tasks, project.board, project.timeline, projects, reports.summary, reports.detailed, reports.utilization, reports.workload, reports.profitability, reports.time-off, reports.time-accounting. |
| updated_at | string | - |
| workspace_id | integer | - |
params
400
Bad Request
402
Timeline feature unavailable on the current plan
403
Timeline permission unavailable for the current role or module
404
Not Found
500
Internal Server Error