Tags
GET Tags
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags
List Workspace tags.
- cURL
 - Go
 - Ruby
 - JavaScript
 - Python
 - Rust
 
curl  https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags \
  -H "Content-Type: application/json" \
  -u <email>:<password>
req, err := http.NewRequest(http.MethodGet, 
  "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags")
if err != nil {
    print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
    print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
    print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags", {
  method: "GET",
  headers: {
	"Content-Type": "application/json",
	"Authorization": `Basic ${base64.encode(<email>:<password>)}`
  },
})
.then((resp) => resp.json())
.then((json) => {
  console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.get('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' %  b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
  let client = Client::new().basic_auth("<email>", "<password>");
  let json = client.request(Method::GET, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags".to_string())
  .header(CONTENT_TYPE, "application/json")
  .send()
  .await?
  .json()
  .await?;
  
  println!("{:#?}", json);
  Ok(())
}
Parameters
Path
| name | type | required | description | 
|---|---|---|---|
| workspace_id | integer | true | Numeric ID of the workspace | 
Query
| name | type | required | description | 
|---|---|---|---|
| page | integer | false | Page number | 
| per_page | integer | false | Number of items per page | 
| search | string | false | Search by task name | 
Response
200
| Name | Type | Description | 
|---|---|---|
| items | Array of object | - | 
items
| 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 | 
403
User does not have access to this resource.
500
Internal Server Error
POST Create tag
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags
Create workspace tags.
- cURL
 - Go
 - Ruby
 - JavaScript
 - Python
 - Rust
 
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags \
  -H "Content-Type: application/json" \
  -d '\{"name":"string"\}' \
  -u <email>:<password>
bytes, err := json.Marshal('\{"name":"string"\}')
if err != nil {
    print(err)
}
req, err := http.NewRequest(http.MethodPost, 
  "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags", bytes.NewBuffer(bytes))
if err != nil {
    print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
    print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
    print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"name":"string"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags", {
  method: "POST",
  body: \{"name":"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.post('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags', json=\{"name":"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::POST, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags".to_string())
.json(&serde_json::json!(\{"name":"string"\}))
  .header(CONTENT_TYPE, "application/json")
  .send()
  .await?
  .json()
  .await?;
  
  println!("{:#?}", json);
  Ok(())
}
Parameters
Path
| name | type | required | description | 
|---|---|---|---|
| workspace_id | integer | true | Numeric ID of the workspace | 
Body
| Name | Type | Description | 
|---|---|---|
| name | string | Tag name | 
Response
200
| Name | Type | Description | 
|---|---|---|
| items | Array of object | - | 
items
| 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 | 
400
Possible errors:
- Invalid JSON input
 - tag name can't be blank
 - a tag with the name '{tag_name}' already exists
 
403
Only organization or workspace administrators may manage tags in this workspace.
500
Internal Server Error
PUT Update tag
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}
Update workspace tags.
- cURL
 - Go
 - Ruby
 - JavaScript
 - Python
 - Rust
 
curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id} \
  -H "Content-Type: application/json" \
  -d '\{"name":"string"\}' \
  -u <email>:<password>
bytes, err := json.Marshal('\{"name":"string"\}')
if err != nil {
    print(err)
}
req, err := http.NewRequest(http.MethodPut, 
  "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}", bytes.NewBuffer(bytes))
if err != nil {
    print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
    print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
    print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"name":"string"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}", {
  method: "PUT",
  body: \{"name":"string"\},
  headers: {
	"Content-Type": "application/json",
	"Authorization": `Basic ${base64.encode(<email>:<password>)}`
  },
})
.then((resp) => resp.json())
.then((json) => {
  console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}', json=\{"name":"string"\}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' %  b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
  let client = Client::new().basic_auth("<email>", "<password>");
  let json = client.request(Method::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}".to_string())
.json(&serde_json::json!(\{"name":"string"\}))
  .header(CONTENT_TYPE, "application/json")
  .send()
  .await?
  .json()
  .await?;
  
  println!("{:#?}", json);
  Ok(())
}
Parameters
Path
| name | type | required | description | 
|---|---|---|---|
| workspace_id | integer | true | Numeric ID of the workspace | 
| tag_id | integer | true | Numeric ID of the tag | 
Body
| Name | Type | Description | 
|---|---|---|
| name | string | Tag name | 
Response
200
| Name | Type | Description | 
|---|---|---|
| items | Array of object | - | 
items
| 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 | 
400
Possible errors:
- Invalid JSON input
 - Invalid tag ID
 - tag name can't be blank
 - a tag with the name '{tag_name}' already exists
 
403
Only organization or workspace administrators may manage tags in this workspace.
404
Tag was not found
500
Internal Server Error
DELETE Delete tag
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}
Delete workspace tags.
- cURL
 - Go
 - Ruby
 - JavaScript
 - Python
 - Rust
 
curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id} \
  -H "Content-Type: application/json" \
  -u <email>:<password>
req, err := http.NewRequest(http.MethodPut, 
  "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}")
if err != nil {
    print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
    print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
    print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}", {
  method: "DELETE",
  headers: {
	"Content-Type": "application/json",
	"Authorization": `Basic ${base64.encode(<email>:<password>)}`
  },
})
.then((resp) => resp.json())
.then((json) => {
  console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.delete('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' %  b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
  let client = Client::new().basic_auth("<email>", "<password>");
  let json = client.request(Method::DELETE, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/tags/{tag_id}".to_string())
  .header(CONTENT_TYPE, "application/json")
  .send()
  .await?
  .json()
  .await?;
  
  println!("{:#?}", json);
  Ok(())
}
Parameters
Path
| name | type | required | description | 
|---|---|---|---|
| workspace_id | integer | true | Numeric ID of the workspace | 
| tag_id | integer | true | Numeric ID of the tag | 
Response
200
Successful operation.
400
Invalid tag ID.
403
Only organization or workspace administrators may manage tags in this workspace.
404
Tag was not found.
500
Internal Server Error