Workspace management

Connect CRM workspaces to the warehouse. API keys are never handled by this UI or stored in the database — they are read at runtime from Supabase secrets only.

Sync from Key Portal

Reads the workspace list from your Key Portal via a token-authenticated call to /api/agent-compass/workspaces (falling back to /api/workspaces). Existing active/inactive flags are preserved, and any credential-shaped fields in the response are discarded before anything is saved.

secrets missing
Last portal sync: never

Add KEY_PORTAL_URL and KEY_PORTAL_TOKEN in Project Settings → Secrets. The token is never displayed, stored in the database, or sent to the browser.

Test all connections

Calls /v1/workspaces/{id}/info for every workspace. Run this first after seeding — it is the fastest way to find a missing or wrong key before a full sync.

1 · Discover via the organization API

Lists every workspace on the organization, then pulls name and timezone per workspace. Requires an org-level admin key. Org key detected: no · Org ID detected: no.

2 · Add a workspace manually

On save the workspace ID is validated against the CRM and the real name and timezone are filled in. If that call fails the row is still saved, flagged unverified — you are not blocked from entering IDs before keys exist.

3 · Bulk paste or CSV import

Accepts workspace_id, workspace_id,name, or workspace_id,name,timezone — commas, semicolons or tabs. Header rows, blank lines and stray whitespace are ignored. Nothing is imported until you press the commit button below.

Key handling: per-workspace keys live only in Supabase secrets named CRM_WS_KEY_<workspace_id>, with CRM_ORG_API_KEY as fallback. This app never accepts, stores, returns, logs or masks a key value — the table shows only whether one resolves at runtime.