Docs

Accounts

What it does

Accounts keep every company in one list, so a deal, a contact, and a meeting all point at the same record.

Open Accounts (/accounts). Search by name, domain, or slug. The drawer edits fields. A person signed in to Cockpit can create a row directly. An agent does not. entity_create on MCP is deprecated and does not insert. The agent files an approval, and a person accepts it. Allowed fields are in Entity fields.

The screen is a thin client. List, create, update, and merge go through the session API under the signed-in user, and row policies apply.

MCP tools

ToolScopeRole
approval_createapprovals:writePropose a company. item_type graph_entity_create, table accounts
entity_field_writegraph:writeWrite one field through provenance
accounts_due_for_enrichmentaccounts:readCompanies whose enrichment is stale
entity_getnone (token still required)Full card by search-entity id
entity_state_getnone (token still required)Read agent_state
entity_state_setaccounts:writeReplace agent_state
entity_state_patchaccounts:writeShallow-merge agent_state
entity_note_addnotes:writeAppend a note
entity_notes_listnotes:readRecent notes
scorecard_getaccounts:readLatest scorecard when record_table is accounts

Do not call MCP entity_create. It returns deprecated and writes nothing.

HTTP endpoints

MethodPathRole
GET/cockpit/api/accountsList. ?q= searches name, domain, and slug
GET/cockpit/api/accounts/searchPicker lookup
POST/cockpit/api/entities/accountsCreate from a signed-in session. Provenance source is human
GET, PATCH, DELETE/cockpit/api/entities/accounts/:idDrawer read, update, delete
POST/cockpit/api/entities/accounts/:id/mergeMerge into the keeper

Permissions

Token scopes come from one permission-set layer. Reads need accounts:read. Field writes from an agent need graph:write or accounts:write as the table above shows. Creates that should wait for a person use approvals:write.

Row access is RLS by creator. Admins see all rows. Members see their own.

Agent example

Call approval_create to propose a company. Do not send owner_user_id, id, or slug inside fields.

{
  "tool": "approval_create",
  "arguments": {
    "item_type": "graph_entity_create",
    "title": "Create account: Example Co",
    "table": "accounts",
    "fields": {
      "name": "Example Co",
      "domain": "example-co.invalid",
      "industry": "software"
    }
  }
}

Expected result: a pending approval. The account row does not exist until a person approves the card. Rejecting the card leaves the list unchanged.

{
  "status": "pending",
  "item_type": "graph_entity_create",
  "title": "Create account: Example Co"
}