List User Workspaces
curl --request GET \
--url https://api.trillet.ai/v1/api/workspaces \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trillet.ai/v1/api/workspaces"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trillet.ai/v1/api/workspaces', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trillet.ai/v1/api/workspaces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/workspaces"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trillet.ai/v1/api/workspaces")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/workspaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"name": "<string>",
"initials": "<string>",
"teamMembers": [
{}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}List User Workspaces
Retrieve all workspaces associated with the authenticated user. If the user does not exist, a new user and default workspace may be automatically created.
GET
/
v1
/
api
/
workspaces
List User Workspaces
curl --request GET \
--url https://api.trillet.ai/v1/api/workspaces \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trillet.ai/v1/api/workspaces"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.trillet.ai/v1/api/workspaces', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trillet.ai/v1/api/workspaces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/workspaces"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trillet.ai/v1/api/workspaces")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/workspaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"name": "<string>",
"initials": "<string>",
"teamMembers": [
{}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}Description
This endpoint returns a list of workspaces where the authenticated user is either:- The owner of the workspace,
- An internal team member, or
- An external team member.
- Check for any pending invitations and join the user to an existing workspace if one exists.
- If no invitation exists, create a default workspace for the user.
- Owned workspaces,
- Team memberships,
- Guest workspaces.
Response Fields
string
Unique identifier of the workspace.
string
Name of the workspace.
string
Initials of the workspace.
array
List of team members associated with the workspace, including their roles and optional external workspace details.
string
Timestamp when the workspace was created (ISO 8601 format).
string
Timestamp when the workspace was last updated (ISO 8601 format).
