Skip to main content
A tenant is the resource and billing boundary inside an environment. Use tenants to isolate each customer, workspace, or project while keeping them under one environment and API key strategy.
Core tenant endpoints are [User+Key]. API keys need the scope shown below and remain limited to their environment and tenant allowlist. Durable-memory administration is [User] only.

Endpoints

MethodPathDescriptionAuth
GET/tenants?env_id=List tenants in an environment[User+Key] tenants:read
GET/tenants/:idGet a tenant and usage counts[User+Key] tenants:read
POST/tenantsCreate a tenant[User+Key] tenants:write
PATCH/tenants/:idUpdate a tenant[User+Key] tenants:write
DELETE/tenants/:idDelete a tenant[User+Key] tenants:delete
GET/tenants/:id/memory-settingsGet durable-memory settings[User]
PATCH/tenants/:id/memory-settingsUpdate durable-memory settings[User] admin
GET/tenants/:id/memoriesList durable memories[User]
DELETE/tenants/:id/memories/:memoryIdDelete a durable memory[User] admin
GET/tenants/:id/memories/graphGet the memory entity graph[User]
For user sessions, owner and billing_admin can create, update, and delete tenants. API keys use scopes instead of organization roles. See Tenancy and Access & scopes.

List tenants

GET /tenants Returns tenants with knowledge-base, document, and storage usage counts.
env_id
string
Environment to list. Required for a user session. With an API key, omit it to use the key’s environment; if supplied, it must match that environment.
curl "https://api.autosage.ai/api/v1/tenants" \
  -H "Authorization: Bearer $AUTOSAGE_KEY"
An empty tenant_ids allowlist on an API key means all tenants in that key’s environment, not no tenants. List explicit IDs when the key should reach only selected tenants.
A key with admin:full lists every tenant in its environment even when tenant_ids contains explicit IDs. Use explicit permission scopes instead of admin:full when tenant-level discovery must remain restricted.

Get a tenant

GET /tenants/:id Returns the tenant’s configuration together with knowledge-base count, document count, and storage used.
id
string
required
Tenant ID.

Create a tenant

POST /tenants
environment_id
string
required
Environment that will own the tenant.
name
string
required
Tenant display name.
external_id
string
Stable identifier from your application, such as a customer or workspace ID.
external_name
string
Human-readable name from your application.
credits_pool
number
Credits to allocate from the organization to this tenant. Must be non-negative and cannot exceed the organization’s available credits.
max_knowledge_bases
number
Maximum knowledge bases allowed for the tenant.
max_documents
number
Maximum documents allowed for the tenant.
max_storage_gb
number
Maximum tenant storage in gigabytes.
metadata
object
Application-defined metadata.
curl -X POST "https://api.autosage.ai/api/v1/tenants" \
  -H "Authorization: Bearer $AUTOSAGE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "environment_id": "ENVIRONMENT_ID",
    "name": "Acme workspace",
    "external_id": "customer_123",
    "credits_pool": 100,
    "max_knowledge_bases": 10,
    "max_documents": 1000,
    "max_storage_gb": 10
  }'

Update a tenant

PATCH /tenants/:id Updates any supplied tenant fields. Accepted fields are name, external_id, external_name, credits_pool, max_knowledge_bases, max_documents, max_storage_gb, and metadata.
id
string
required
Tenant ID.

Delete a tenant

DELETE /tenants/:id Deletes the tenant and the knowledge bases, documents, chats, agents, and other data it owns. Credit allocation is reconciled with the organization.
id
string
required
Tenant ID.
Tenant deletion is irreversible. Confirm the tenant ID and export anything you need before deleting it.

Durable memory

Memory management endpoints require a user session. Any organization member can read settings, memories, and the entity graph; only owner and billing_admin can change settings or delete a memory.

Get memory settings

GET /tenants/:id/memory-settings Returns the resolved mode and retention settings.
id
string
required
Tenant ID.

Update memory settings

PATCH /tenants/:id/memory-settings
id
string
required
Tenant ID.
mode
string
disabled or durable.
retention
string
none, explicit_only, or automatic. explicit_only stores facts only when a user explicitly asks AutoSage to remember them; automatic also retains useful context after conversations.
curl -X PATCH "https://api.autosage.ai/api/v1/tenants/TENANT_ID/memory-settings" \
  -H "Cookie: YOUR_SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "durable", "retention": "automatic" }'

List memories

GET /tenants/:id/memories
id
string
required
Tenant ID.
limit
number
Maximum number of memories to return.
offset
number
Number of memories to skip.
q
string
Search text used to filter memories.
When durable memory is disabled or unavailable, this endpoint returns a disabled result instead of failing the read flow.

Delete a memory

DELETE /tenants/:id/memories/:memoryId
id
string
required
Tenant ID.
memoryId
string
required
Memory ID returned by the list endpoint.

Get the entity graph

GET /tenants/:id/memories/graph Returns the entities and relationships extracted from durable memory. Tenants without active durable memory return an empty graph. See Durable memory for recall, retention, and knowledge-base isolation behavior.

Next steps

Tenancy model

Design secure customer and environment boundaries.

Billing & usage

Inspect credits and usage for each tenant.

Knowledge bases

Create content containers inside a tenant.