List workspaces
Viewing v1— superseded by v2
curl --request GET \ --url https://api.app.layer.ai/api/v1/workspaces \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v1/workspaces"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v1/workspaces';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.app.layer.ai/api/v1/workspaces"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.app.layer.ai/api/v1/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 => [ "Authorization: Bearer <token>" ],]);
$response = curl_exec($curl);$err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v1/workspaces") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();require 'uri'require 'net/http'
url = URI("https://api.app.layer.ai/api/v1/workspaces")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Get.new(url)request["Authorization"] = 'Bearer <token>'
response = http.request(request)puts response.read_bodyvar client = new RestClient("https://api.app.layer.ai/api/v1/workspaces");var request = new RestRequest("", Method.Get);request.AddHeader("Authorization", "Bearer <token>");var response = client.Execute(request);v1 is superseded. v1 was superseded by v2 on 2026-08-26. A sunset date has not been announced yet; v1 will be deprecated as a whole before removal. Migrate with the v2 migration guide.
List all workspaces the authenticated user belongs to, with Creative Units balance details.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”Successful Response
object
All workspaces the authenticated user belongs to, ordered by most recently active first.
object
The workspace’s unique identifier.
The workspace slug (its representation in the app URL).
The workspace display name.
Total Creative Units balance before reservations.
Creative Units reserved by in-progress generations.
Usable balance (balance minus reserved). Can be negative.
Examplegenerated
{ "workspaces": [ { "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "slug": "example", "name": "example", "balance_creative_units": 1, "reserved_creative_units": 1, "available_creative_units": 1, "last_active_at": "2026-04-15T12:00:00Z" } ], "pagination": { "next_cursor": "example", "has_more_results": true, "total_count": 1 }}Unauthenticated — missing or invalid Bearer token.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Forbidden — insufficient permissions.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Resource not found.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Invalid input parameters.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Rate limited — too many concurrent requests.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Internal server error.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}