Log in Create workspace
Skip to content

API reference

Operator - Workspaces

Discover accessible workspaces and update the selected workspace's editable profile.

Jump to 3 endpoints
On this page

Overview

Workspace endpoints list every workspace reached through an active membership, show a selected accessible workspace, and update only the session's current workspace. Operator updates cover profile and settings fields; billing-owned plan and platform-owned status are ignored.

Show and update have different scope
GET /workspaces/:id may read any workspace where the user has an active membership. PUT accepts only scope.workspace.id, so a different accessible UUID returns 404 rather than changing session context.
Ownership boundaries protect fields
Operators may edit name, slug, summary, and permitted settings. plan belongs to billing and status belongs to platform administration; supplying either does not make this endpoint authoritative for it.

Before you begin

  • A signed-in browser session with a selected workspace backed by an active membership is required; an archived workspace remains readable but rejects mutations. Every /api/v1/operator endpoint rejects API credentials and bearer tokens, regardless of their scopes.
  • Any active membership can list and show accessible workspaces. Only an owner or admin can update the current workspace.
  • Switch the session to the workspace you intend to edit; membership in another workspace is enough to show it, but not to update it while it is non-current.

How it works

  1. Choose the canonical workspace

    List workspaces and compare id, slug, plan, and status. Use the application switcher to make the target current before opening scoped members, invitations, or management routes.

  2. Update carefully

    Validate a new slug against lowercase letters, numbers, and hyphens and expect platform-wide uniqueness checks. A supplied settings value replaces the settings map rather than deep-merging it, so preserve keys you still need; then re-read the workspace.

Examples

These examples are illustrative. Replace the sample values with your own. Keep credentials in environment variables or a secret manager, never in client-side code.

List accessible workspaces

This read is useful before selecting an ID for a current-workspace operation.

javascript
const response = await fetch("/api/v1/operator/workspaces", {
  credentials: "same-origin",
  headers: {"Accept": "application/json"}
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${body.detail}`);
console.log(body);
What to expect

200 OK. The response is wrapped in a workspaces array; each row includes id, name, slug, summary, plan, status, settings, and timestamps.

Troubleshooting

Update returns 404 for an accessible workspace
PUT is intentionally narrower than GET: the ID must be the session's current workspace. Switch through /app before trying the update again.
A write returns workspace_archived
Archived workspaces remain readable for history but every operator mutation is blocked. Reactivation is not part of this API.

Endpoint reference

Ready to integrate? Open an endpoint for its required permissions, request fields, response format, and status codes. The examples above explain the workflow; these details define each individual request.

GET
/api/v1/operator/workspaces Web Session

List user workspaces

Description

Returns every workspace the signed-in user belongs to. Auth is a browser session (CSRF is not required for this read); machine Bearer tokens (`agk_` / access tokens) are refused with 401 "An authenticated operator session is required."

Auth

Web Session
Responses
200

Workspaces the session user can access

Returns: WorkspaceList

Response Body
Field Type Required Description
workspaces array<object> Yes Workspace records
workspaces[].id string Yes Workspace UUID
workspaces[].name string Yes Workspace name
workspaces[].status string (active, paused, archived) Yes Workspace status (read-only on this API)
workspaces[].plan string (starter, growth, scale) Yes Billing plan (read-only on this API)
workspaces[].settings object Yes Workspace settings map
workspaces[].inserted_at datetime (ISO 8601) Yes Created at
workspaces[].updated_at datetime (ISO 8601) Yes Updated at
workspaces[].summary string No Short description
workspaces[].slug string Yes URL slug
Example
{
  "workspaces": [
    {
      "id": "4ce4d170-e6d5-4118-8f4d-fac69dc099ea",
      "inserted_at": "2026-01-15T10:00:00Z",
      "name": "Acme Corp",
      "plan": "growth",
      "settings": {
        "data_controls": {
          "allow_self_serve_exports": true,
          "auto_purge_enabled": false,
          "eval_retention_days": 180,
          "export_formats": [
            "json"
          ],
          "include_audit_log_exports": true,
          "location_retention_days": 90,
          "trace_retention_days": 90,
          "work_order_evidence_retention_days": 400
        },
        "observability": {
          "redacted_keys": [
            "authorization",
            "cookie"
          ],
          "redaction_enabled": true
        }
      },
      "slug": "acme-corp",
      "status": "active",
      "summary": "Payments and fulfillment agents",
      "updated_at": "2026-03-27T09:00:00Z"
    }
  ]
}
401

No operator browser session

GET
/api/v1/operator/workspaces/:id Web Session

Get workspace details

Description

Returns one workspace the signed-in user has an active membership in. The path UUID does not have to be the session's current workspace. Disabled or invited memberships do not grant read access (404).

Auth

Web Session
Parameters
Name In Type Required Description
id path string Yes Workspace UUID. Any workspace with an active membership is readable.
Responses
200

Workspace details

Returns: Workspace

Response Body
Field Type Required Description
id string Yes Workspace UUID
name string Yes Workspace name
status string (active, paused, archived) Yes Workspace status (read-only on this API)
plan string (starter, growth, scale) Yes Billing plan (read-only on this API)
settings object Yes Workspace settings map
inserted_at datetime (ISO 8601) Yes Created at
updated_at datetime (ISO 8601) Yes Updated at
summary string No Short description
slug string Yes URL slug
Example
{
  "id": "4ce4d170-e6d5-4118-8f4d-fac69dc099ea",
  "inserted_at": "2026-01-15T10:00:00Z",
  "name": "Acme Corp",
  "plan": "growth",
  "settings": {
    "data_controls": {
      "allow_self_serve_exports": true,
      "auto_purge_enabled": false,
      "eval_retention_days": 180,
      "export_formats": [
        "json"
      ],
      "include_audit_log_exports": true,
      "location_retention_days": 90,
      "trace_retention_days": 90,
      "work_order_evidence_retention_days": 400
    },
    "observability": {
      "redacted_keys": [
        "authorization",
        "cookie"
      ],
      "redaction_enabled": true
    }
  },
  "slug": "acme-corp",
  "status": "active",
  "summary": "Payments and fulfillment agents",
  "updated_at": "2026-03-27T09:00:00Z"
}
401

No operator browser session

404

Workspace not found or no active membership

PUT
/api/v1/operator/workspaces/:id Web Session

Update workspace

Description

Updates the session's current workspace. `:id` must equal `current_scope.workspace.id`; any other UUID is 404 even if the caller is an owner or admin of that other workspace. Owner/admin only (`403` `admin_required` for members, `read_only_role` for auditors). Writable fields are `name`, `slug`, `summary`, and `settings`. `plan` and `status` are dropped — operators cannot change billing plan or pause/archive via this API. Shipped `settings` keys include `observability.redaction_enabled` / `observability.redacted_keys` and `data_controls` (`trace_retention_days`, `eval_retention_days`, `auto_purge_enabled`, `allow_self_serve_exports`, `include_audit_log_exports`, `export_formats`). `allow_self_serve_exports` is stored only; it does not let a member call the operator export/deletion/purge routes (those still require owner/admin).

Auth

Web Session
Request Body
Field Type Required Description
workspace object Yes Workspace attributes to update
workspace.name string No Workspace name (2–120 characters)
workspace.status string No Ignored. Status is platform-admin only (active | paused | archived).
workspace.plan string No Ignored. Plan is billing-owned and is never written here.
workspace.settings object No Replacement settings map (not deep-merged). Shipped keys: observability.redaction_enabled, observability.redacted_keys, data_controls.trace_retention_days (default 90), data_controls.eval_retention_days (default 180), data_controls.location_retention_days (default 90), data_controls.work_order_evidence_retention_days (default 400), data_controls.auto_purge_enabled (trace/eval only), data_controls.allow_self_serve_exports (stored flag only; does not authorize member exports), data_controls.include_audit_log_exports, data_controls.export_formats. Nonpositive values or values that are not whole numbers of days (including positive fractions) use each default; positive whole values above 36500 days clamp to 36500. The workspace LiveView form rejects over-cap values instead of clamping them. Fleet retention runs separately on rollups regardless of auto_purge_enabled.
workspace.summary string No Short workspace description
workspace.slug string No URL slug (`^[a-z0-9-]+$`); unique across the platform
Parameters
Name In Type Required Description
id path string Yes Must be the session's current workspace UUID. Other workspace IDs 404.
Responses
200

Workspace updated

Returns: Workspace

Response Body
Field Type Required Description
id string Yes Workspace UUID
name string Yes Workspace name
status string (active, paused, archived) Yes Workspace status (read-only on this API)
plan string (starter, growth, scale) Yes Billing plan (read-only on this API)
settings object Yes Workspace settings map
inserted_at datetime (ISO 8601) Yes Created at
updated_at datetime (ISO 8601) Yes Updated at
summary string No Short description
slug string Yes URL slug
Example
{
  "id": "4ce4d170-e6d5-4118-8f4d-fac69dc099ea",
  "inserted_at": "2026-01-15T10:00:00Z",
  "name": "Acme Corp",
  "plan": "growth",
  "settings": {
    "data_controls": {
      "allow_self_serve_exports": true,
      "auto_purge_enabled": false,
      "eval_retention_days": 180,
      "export_formats": [
        "json"
      ],
      "include_audit_log_exports": true,
      "location_retention_days": 90,
      "trace_retention_days": 90,
      "work_order_evidence_retention_days": 400
    },
    "observability": {
      "redacted_keys": [
        "authorization",
        "cookie"
      ],
      "redaction_enabled": true
    }
  },
  "slug": "acme-corp",
  "status": "active",
  "summary": "Payments and fulfillment agents",
  "updated_at": "2026-03-27T09:00:00Z"
}
401

No operator browser session

403

Owner or admin membership required, or the workspace is archived/read-only

404

Not the session's current workspace, or workspace not found

422

Validation error (name length, slug format/uniqueness)

Where to go next

see also