D Diagent docs

Platform admin

Platform overview

The platform admin console is the operator-only surface at /admin. It's where you manage plans, watch usage across every workspace, retry failed jobs, and impersonate customers for support. Only users with role = super_admin can see it โ€” everyone else gets a 404 (not 403) so the panel doesn't even reveal it exists.

Becoming a super admin

The flag is the users.role column, cast to the PlatformRole enum which has two cases: customer (the default for every signup) and super_admin. There's no UI to grant it โ€” it's set by hand via tinker or a one-shot migration on a new deployment:

php artisan tinker --execute 'User::where("email", "[email protected]")->update(["role" => "super_admin"]);'

Demoting works the same way (role = "customer"). There's no notification โ€” the next page load will show or hide the admin nav.

Layout

The admin sidebar lists ten sections:

  • Dashboard โ€” KPIs across all workspaces, system health summary.
  • Workspaces โ€” every workspace, their plan, owner, member count, conversation usage.
  • Users โ€” every user across the platform, their workspaces, last seen.
  • Agents โ€” every agent on the platform, with workspace + publish state.
  • Conversations โ€” every conversation. Useful for support.
  • Leads โ€” every lead.
  • Plans โ€” Stripe-synced plan CRUD. See Plans & Stripe sync.
  • Subscriptions โ€” every active subscription. Reverse-lookup workspaces by Stripe subscription ID.
  • Usage โ€” month-over-month conversation count by workspace.
  • Queue Failures โ€” failed jobs with retry / forget controls.

Header actions

The admin header (top bar of every admin page) has:

  • Site Health pill โ€” green / amber / red. Hover for the breakdown โ€” failed jobs, Stripe config, LLM provider, vector store, mail driver, Reverb keys, cache. See Site health & failed jobs.
  • Notifications dropdown โ€” unread alerts (failed jobs, missing Stripe key, etc.).
  • Global search โ€” searches workspaces, users, agents, conversations, leads with one keystroke.

Impersonation

From the Workspaces or Users page, click Impersonate. A few things happen:

  1. Your admin session is preserved.
  2. You become the target user inside their workspace.
  3. A persistent You're impersonating X banner appears at the top of every page until you stop.
  4. A row is logged in audit_logs so the action is traceable.

Click Stop impersonating in the banner to drop back to your admin session. The banner is intentionally hard to miss โ€” there's no shortcut to dismiss it without ending the impersonation.

Search

Press / from anywhere in the admin panel. The global search dropdown opens with sections:

  • Workspaces (by name).
  • Users (by email).
  • Agents (by name + workspace).
  • Conversations (by message text).
  • Leads (by name + email).

Each result links straight to the resource. The customer surface has the same search but scoped to the current workspace.

Audit log

Every admin action โ€” plan create/update/delete, impersonation start/stop, workspace changes โ€” writes to the audit_logs table for forensic traceability. There's no UI page for browsing audit logs in v1; query the table directly when you need to investigate.