List workspaces

SDK platic.workspaces.list()

Get the IDs of the workspaces you can use and choose one for your next calls. Send its id as ?workspace= when the operation needs a specific workspace.

Example

await platic.workspaces.list();

The MCP tool list_workspaces queries the same directory.

It does not require permission for a workspace module. Use it to find available workspaces before calling their resources.

It accepts both Bearer credentials: an OAuth access token (pl_at_…) or an API Key (pl_key_…). See Authentication.


Response

{
  "status": "success",
  "data": [
    {
      "id": "g6yCA16pkWl5eXo7KszB",
      "name": "Acme Norte",
      "role": "admin",
      "modules": "all"
    },
    {
      "id": "k2pL90vQmN4sHxYwR8cD",
      "name": "Acme Support",
      "role": "operator",
      "modules": ["dashboard", "conversations", "agents", "campaigns", "contacts", "chat"]
    }
  ],
  "active": null,
  "requires_workspace_argument": true,
  "credential": {
    "type": "oauth",
    "scopes": ["platica:read", "platica:write", "offline_access"]
  }
}

data is the list of workspaces this credential can reach right now. To know how many there are, use data.length. active, requires_workspace_argument, and credential are top-level fields, next to data.

FieldTypeDescription
data[].idstringValue of ?workspace= (or the workspace argument in MCP).
data[].namestringCompany name in Platica.
data[].rolestring | nullThe user's role in that workspace.
data[].modules"all" | string[]Modules with access. For OAuth they come from the live role; for an API Key they are "all".
activestring | nullIf the credential covers one workspace, its id. If it covers several, null.
requires_workspace_argumentbooleantrue if the credential covers several workspaces. For operations that require one specific workspace, send ?workspace= (or workspace in MCP).
credential.typestring"apiKey", "oauth", or "internal".
credential.scopesstring[]OAuth only. The scopes granted at consent.

Errors

Statusdetails.codeWhen it happens
401UNAUTHENTICATEDMissing Bearer, or the token/key is not valid
404WORKSPACE_NOT_FOUNDThe credential has no reachable workspace
{
  "code": 404,
  "error": "Not Found - The resource doesn't exist",
  "details": {
    "code": "WORKSPACE_NOT_FOUND",
    "message": "No workspaces found for this credential"
  }
}

The general error format is in Errors.