Reference
API: Workspaces
| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | /v1/workspaces | List workspaces (brands) in the organization | settings:read |
| POST | /v1/workspaces | Create a workspace (owner) | settings:write |
| DELETE | /v1/workspaces/:id | Delete a workspace (owner) | settings:write |
| PATCH | /v1/workspaces/:id | Rename a workspace, or set its profile, language, currency and time zone (owner) | settings:write |
| GET | /v1/workspaces/:id/budget | A workspace's monthly budget and what its keys spent this month | gateway:read |
| PUT | /v1/workspaces/:id/budget | Set a workspace's monthly budget (null: none). Its keys stop at it. Agents may only lower it. | gateway:write |
| PUT | /v1/workspaces/:id/members | Limit people to this workspace's records (with their other workspaces); an empty list clears it (owner) (web app only) | members:write |
| DELETE | /v1/workspaces/limits/:userId | Lift a person's workspace limit (they see every workspace's records) (owner) (web app only) | settings:write |
Examples
GET /v1/workspaces
List workspaces (brands) in the organization
curl -s "https://manage.restolayer.com/v1/workspaces" \
-H "Authorization: Bearer $LG_API_KEY"const res = await fetch(`https://manage.restolayer.com/v1/workspaces`, {
method: "GET",
headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();POST /v1/workspaces
Create a workspace (owner)
curl -s -X POST "https://manage.restolayer.com/v1/workspaces" \
-H "Authorization: Bearer $LG_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://manage.restolayer.com/v1/workspaces`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();DELETE /v1/workspaces/$ID
Delete a workspace (owner)
curl -s -X DELETE "https://manage.restolayer.com/v1/workspaces/$ID" \
-H "Authorization: Bearer $LG_API_KEY"const res = await fetch(`https://manage.restolayer.com/v1/workspaces/${id}`, {
method: "DELETE",
headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();PATCH /v1/workspaces/$ID
Rename a workspace, or set its profile, language, currency and time zone (owner)
curl -s -X PATCH "https://manage.restolayer.com/v1/workspaces/$ID" \
-H "Authorization: Bearer $LG_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://manage.restolayer.com/v1/workspaces/${id}`, {
method: "PATCH",
headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();GET /v1/workspaces/$ID/budget
A workspace's monthly budget and what its keys spent this month
curl -s "https://manage.restolayer.com/v1/workspaces/$ID/budget" \
-H "Authorization: Bearer $LG_API_KEY"const res = await fetch(`https://manage.restolayer.com/v1/workspaces/${id}/budget`, {
method: "GET",
headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();PUT /v1/workspaces/$ID/budget
Set a workspace's monthly budget (null: none). Its keys stop at it. Agents may only lower it.
curl -s -X PUT "https://manage.restolayer.com/v1/workspaces/$ID/budget" \
-H "Authorization: Bearer $LG_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://manage.restolayer.com/v1/workspaces/${id}/budget`, {
method: "PUT",
headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();Request and response schemas: https://www.restolayer.com/openapi.json. All resources: API reference.