API Reference
Sub-resources
orgs, roles, teams, and memories — sub-resources on the Node MemsyClient.
MemsyClient exposes four sub-resources for the onboarding hierarchy and console memory browsing. They behave identically to the Python equivalents — same endpoints, same parameter shapes, with camelCased field names and Promise<T> returns.
import { MemsyClient } from '@memsy-io/memsy';
const client = new MemsyClient({
baseUrl: process.env.MEMSY_BASE_URL!,
apiKey: process.env.MEMSY_API_KEY!,
});
client.orgs; // OrgsResource
client.roles; // RolesResource
client.teams; // TeamsResource
client.memories; // MemoriesResourceMost onboarding mutation endpoints (create/update/regenerate/delete) are admin-gated. Non-admin keys raise MemsyAuthorizationError.
client.orgs
await client.orgs.list(); // Org[]
await client.orgs.create(orgId, name, focus); // Org
await client.orgs.get(orgId); // Org
await client.orgs.update(orgId, { name, focus, promotionPrompt }); // Org
await client.orgs.regeneratePrompt(orgId); // Org
await client.orgs.delete(orgId); // void| Method | Signature |
|---|---|
list() | Promise<Org[]> |
create(orgId, name, focus) | Promise<Org> |
get(orgId) | Promise<Org> |
update(orgId, update) | Promise<Org> — OrgUpdate |
regeneratePrompt(orgId) | Promise<Org> |
delete(orgId) | Promise<void> |
OrgUpdate is { name?, focus?, promotionPrompt? }.
client.roles
Roles always require an orgId.
await client.roles.list(orgId, { limit, offset }); // Role[]
await client.roles.create(orgId, name, focus); // Role
await client.roles.get(roleId, orgId); // Role
await client.roles.update(roleId, orgId, { name, focus, promotionPrompt }); // Role
await client.roles.regeneratePrompt(roleId, orgId); // Role
await client.roles.delete(roleId, orgId); // voidclient.teams
Same shape as roles — every method takes an orgId.
await client.teams.list(orgId, { limit, offset }); // Team[]
await client.teams.create(orgId, name, focus); // Team
await client.teams.get(teamId, orgId); // Team
await client.teams.update(teamId, orgId, { name, focus, promotionPrompt }); // Team
await client.teams.regeneratePrompt(teamId, orgId); // Team
await client.teams.delete(teamId, orgId); // voidclient.memories
Read-only console memory browsing.
await client.memories.list({ // MemoryListResponse
actorId: 'user_42', // filter to a single actor
kind: 'semantic',
type: 'preference',
status: 'active',
sort: 'observed_at_desc',
search: 'dark mode',
limit: 50,
offset: 0,
});
await client.memories.stats(); // MemoryStatsResponse
await client.memories.get(memoryId); // MemoryItemPagination is stable across pages: the server always sorts with memory_id as a secondary tiebreaker, so walking offset won't return duplicates or skip records.
| Method | Signature |
|---|---|
list(options?) | Promise<MemoryListResponse> — MemoryListOptions |
stats() | Promise<MemoryStatsResponse> |
get(memoryId) | Promise<MemoryItem> |
MemoryListOptions is { kind?, type?, status?, sort?, search?, limit?, offset? }.
See also
- Models reference — full shape of
Org,Role,Team,MemoryItem, etc. - Onboarding guide — when and why to set up the hierarchy
- Console Memories guide — patterns for browsing/auditing memories