Workspaces & Team Management
A workspace holds your environments, API keys, members and usage. Members have one of three roles.
A workspace holds your environments, API keys, members and usage. Each workspace has its own data and its own members.
The endpoints on this page are the ones the console uses. They take a signed-in console session, not an API key. Most teams manage members and keys in the console under Settings.
Getting workspace information
List your workspaces
curl https://api.anlyon.com/api/v2/workspaces \
-H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN"
{
"success": true,
"data": [
{
"workspace": {
"id": "2f8a1f72-7cf9-4fef-95e8-df9de5f2f5d0",
"name": "My Workspace",
"slug": "my-workspace",
"plan": "free",
"createdAt": "2026-09-23T10:00:00Z"
},
"role": "owner",
"joinedAt": "2026-09-23T10:00:00Z"
}
]
}
Team management
List workspace members
curl https://api.anlyon.com/api/v2/workspaces/$WORKSPACE_ID/members \
-H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN"Invite someone by email
An owner or admin sends an invitation. The person joins when they accept it. A pending invitation counts as a seat.
curl -X POST https://api.anlyon.com/api/v2/workspaces/$WORKSPACE_ID/invitations \
-H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "newmember@example.com",
"role": "member"
}'role is admin or member.
Update a member's role
curl -X PATCH https://api.anlyon.com/api/v2/workspaces/$WORKSPACE_ID/members/$USER_ID \
-H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"role": "admin"
}'Remove a member
curl -X DELETE https://api.anlyon.com/api/v2/workspaces/$WORKSPACE_ID/members/$USER_ID \
-H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN"Roles
There are three roles: owner, admin and member. Each role can do what the one below it can.
| Role | What it adds |
|---|---|
| Member | Read the workspace, its members and its API keys. Decide approvals in the console |
| Admin | Change workspace settings. Invite, re-role and remove members. Create, regenerate and delete API keys. Create environments, and halt or resume one. Create and promote agents. Change approval policies |
| Owner | Delete the workspace. Transfer ownership. Delete an empty environment. Change the plan, payment method and overage alert |
Any workspace member can decide an approval.
API key management
List API keys
curl https://api.anlyon.com/api/v2/workspaces/$WORKSPACE_ID/api-keys \
-H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN"
Create an API key
An admin or owner creates keys. Name the environment the key belongs to and the scopes it holds. See Authentication & API Keys.
curl -X POST https://api.anlyon.com/api/v2/workspaces/$WORKSPACE_ID/api-keys \
-H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Support agent, staging",
"environmentId": "ENVIRONMENT_ID",
"scopes": ["actions:invoke", "actions:read", "approvals:read"],
"expiresAt": "2027-12-31T23:59:59Z"
}'
Good practice
- Give the admin role to the people who need to change keys, members or policies.
- Review members and API keys on a schedule.
- Set an expiry on keys, and delete the ones you no longer use.

