Skip to main content
A workspace is the top-level tenant in gavAI. Every resource — pages, agents, tokens, secrets, deployments, domains — lives inside one workspace and is addressed by its slug. The Workspaces resource lets you list the workspaces a token can reach, resolve the current default, and switch the active context on OAuth sessions. By the end of this page you will know which endpoints exist and how switching differs between key types.

A first call

curl https://api.gavai.app/v1/workspaces \
  -H "Authorization: Bearer gak_live_xxxxxxxxxxxxx"
Workspaces are returned as cursor-paginated data — see Pagination for the iteration protocol.

Endpoints

List all workspaces accessible to this token. Resolve the default workspace for this token or session. Fetch a single workspace by slug. Switch the active workspace context (OAuth sessions only).

Default workspace resolution

PrincipalWhat GET /v1/workspaces/current returns
Workspace API keyThe workspace the key was minted against. Always the same.
OAuth session tokenThe workspace active when the session was established, or the workspace last switched to via /switch.

Switching context

Switch applies only to OAuth session tokens. API keys are workspace-scoped at mint time and cannot be redirected — mint a new key against the target workspace instead. The endpoint returns the workspace that is now active for the session: Common errors:

API tokens

Create, rotate, and revoke workspace API keys.