Brainby arc-labs/docs
Sdk typescriptOrganisation
TypeScript SDK

Organisation

Manage org profile, membership (invite, remove), and plan usage with recall.org.

The organisation is the root tenancy unit in Recall. Every agent, namespace, and API key belongs to exactly one org. The recall.org resource lets you inspect and manage that root layer programmatically — useful for onboarding automation, compliance reporting, and pre-flight capacity checks before bulk operations.

org.profile(options?)

GET/v1/orgAPI key (admin)stable
recall.org.profile(options?: TransportRequestOptions): Promise<OrgProfile>

Returns the org's current profile.

Returns

FieldTypePresence
idstringalways
Stable opaque org identifier.
namestringalways
Display name shown in the dashboard.
slugstringalways
URL-safe identifier used in API paths and the dashboard URL. Immutable after initial creation.
createdAtstringalways
ISO 8601 timestamp of when the org was provisioned.

Example

const profile = await recall.org.profile()
console.log(`Org: ${profile.name} (${profile.slug})`)

Errors

CodeStatusRetry
UNAUTHORIZED401fatal
Missing or invalid API key.
FORBIDDEN403fatal
Key lacks admin scope.

org.patchProfile(changes, options?)

PATCH/v1/orgAPI key (admin)stable
recall.org.patchProfile(
  changes: { name?: string },
  options?: TransportRequestOptions
): Promise<OrgProfile>

Update mutable fields on the org profile. Currently only name is patchable. Returns the full updated OrgProfile.

slug is immutable once set during org creation. If you need to change it, contact support — it requires a migration of all dashboard links and webhook URLs that reference the slug.

Parameters

ParameterTypeRequired
changes.namestringoptional
New display name for the org. Shown in the dashboard and billing invoices.
optionsTransportRequestOptionsoptional
Per-request transport overrides.

Example

const updated = await recall.org.patchProfile({ name: 'Acme AI (Production)' })
console.log('Name updated to:', updated.name, 'at', updated.createdAt)

Errors

CodeStatusRetry
UNAUTHORIZED401fatal
Missing or invalid API key.
FORBIDDEN403fatal
Key lacks admin scope.
VALIDATION_ERROR422fatal
Name fails length or character validation.

org.members(opts?, options?)

GET/v1/org/membersAPI key (admin)stable
recall.org.members(
  opts?: { limit?: number; cursor?: string },
  options?: TransportRequestOptions
): PagedRequest<OrgMember>

Returns a PagedRequest<OrgMember> listing every active member of the org. await for the first page, for await to auto-paginate.

OrgMember (per item)

FieldTypePresence
userIdstringalways
The member's stable user identifier.
emailstringalways
The member's email address.
rolestringalways
One of owner, admin, or member. See role table below.
joinedAtstringalways
ISO 8601 timestamp of when the user accepted the invite or was first added.

Roles

RolePermissions
ownerFounding user. Immutable — cannot be transferred or removed.
adminFull control: manage members, billing, all API keys, all agents.
memberRead/write memories within assigned agent scope. Cannot manage members or billing.

Example

// Print all admins
for await (const m of recall.org.members()) {
  if (m.role === 'admin' || m.role === 'owner') {
    console.log(m.email, m.role)
  }
}

Errors

CodeStatusRetry
UNAUTHORIZED401fatal
Missing or invalid API key.
FORBIDDEN403fatal
Key lacks admin scope.

org.inviteMember(email, role, options?)

POST/v1/org/membersAPI key (admin)stable
recall.org.inviteMember(
  email: string,
  role: 'admin' | 'member',
  options?: TransportRequestOptions
): Promise<OrgMember>

Sends an email invitation to the specified address. The response reflects the intended member record — the invitee's joinedAt is set optimistically and the record becomes fully active when they log in for the first time. Inviting an address that is already a member is idempotent: the server returns the existing record and does not resend the email.

Parameters

ParameterTypeRequired
emailstringrequired
Email address to invite. Must be a valid RFC 5322 address.
role'admin' | 'member'required
Role to assign. Cannot invite an owner — there is exactly one owner per org.
optionsTransportRequestOptionsoptional
Per-request transport overrides.

Example

const member = await recall.org.inviteMember('engineer@acme.com', 'member')
console.log('Invited:', member.email, 'role:', member.role)

Errors

CodeStatusRetry
UNAUTHORIZED401fatal
Missing or invalid API key.
FORBIDDEN403fatal
Key lacks admin scope, or caller attempted to assign owner role.
VALIDATION_ERROR422fatal
Invalid email format or role value.

org.removeMember(userId, options?)

DELETE/v1/org/members/:userIdAPI key (admin)stable
recall.org.removeMember(userId: string, options?: TransportRequestOptions): Promise<DeleteResult>

Removes a member from the org. The user loses access to the dashboard and all admin-plane operations immediately. Returns DeleteResult: { id, deletedAt }.

Removing a member does NOT auto-revoke their API keys. Keys issued to agents in the org continue to authenticate until you explicitly call recall.keys.delete() on each one. Audit recall.keys.list() after removing a member to revoke any keys they issued.

Example

const result = await recall.org.removeMember('usr_xyz789')
console.log('Removed at:', result.deletedAt)

// Follow up: revoke any keys the user issued
for await (const key of recall.keys.list()) {
  if (key.createdBy === 'usr_xyz789') {
    await recall.keys.delete(key.id)
  }
}

Errors

CodeStatusRetry
UNAUTHORIZED401fatal
Missing or invalid API key.
FORBIDDEN403fatal
Key lacks admin scope, or caller attempted to remove the owner.
NOT_FOUND404fatal
User ID is not a member of this org.

org.plan(options?)

GET/v1/org/planAPI key (admin)stable
recall.org.plan(options?: TransportRequestOptions): Promise<PlanInfo>

Returns current plan tier and real-time usage counters. Use this for pre-flight capacity checks before bulk write operations and for building usage dashboards.

Returns

FieldTypePresence
tierstringalways
Plan tier name (e.g. 'free', 'pro', 'enterprise').
memoriesUsednumberalways
Count of active (non-deleted) memories across all agents in the org.
memoriesLimitnumberalways
Plan cap. -1 means unlimited.
agentsUsednumberalways
Count of active agents.
agentsLimitnumberalways
Plan cap. -1 means unlimited.
namespacesUsednumberalways
Count of active namespaces.
namespacesLimitnumberalways
Plan cap. -1 means unlimited.

Limits reset on the billing-cycle anniversary — not on the first of the calendar month. Check PlanInfo rather than assuming a monthly boundary.

Example — pre-flight guard before a bulk import

const plan = await recall.org.plan()
const headroom = plan.memoriesLimit - plan.memoriesUsed
if (plan.memoriesLimit !== -1 && headroom < batchSize) {
  throw new Error(
    `Only ${headroom} memory slots remain on the ${plan.tier} plan. ` +
    `Upgrade or call recall.forget() to free space before importing.`
  )
}

// Safe to proceed
await importMemories(batch)

Errors

CodeStatusRetry
UNAUTHORIZED401fatal
Missing or invalid API key.
FORBIDDEN403fatal
Key lacks admin scope.

Was this page helpful?

On this page