HTTP API¶
This page lists the HTTP routes the spongram service exposes besides the MCP endpoint: health probes, the brain-key API under /v1, the admin API under /admin/api/spongram, and the API of the Cloud control plane. The MCP endpoint itself (POST /mcp) is described in the MCP server overview and the tools reference.
All routes are served by one FastAPI process on port 8091. Examples use https://spongram.example.com as the public address.
Editions and mounted routes¶
The service reads SPONGRAM_EDITION, which takes two values: cloud, the default, used by every server deployment, and local, the desktop edition. The Cloud control plane (organisations, accounts, per-brain permissions) is a separate switch on a server: SPONGRAM_CLOUD_CONTROL_ENABLED=true. In this page, "server" means any deployment that is not the desktop edition.
| Deployment | Settings | What changes for the HTTP API |
|---|---|---|
| Server | SPONGRAM_EDITION=cloud (default), SPONGRAM_CLOUD_CONTROL_ENABLED=false (default) |
Admin API authenticated by the admin token. No /console/api routes. |
| Server with the Cloud control plane | SPONGRAM_EDITION=cloud, SPONGRAM_CLOUD_CONTROL_ENABLED=true |
Admin API authenticated by a console session and checked against per-brain permissions. /console/api/* and the workflow routes are mounted. |
| Desktop edition | SPONGRAM_EDITION=local |
Brain-key routes need no key. Ingestion-queue, backfill, code-map purge and marketplace admin routes are not mounted. /v1/settings/*, /v1/bundle/* and /v1/brain/* are added. |
Authentication¶
| Scheme | Header | Used by | Notes |
|---|---|---|---|
| Brain key | Authorization: Bearer spt_brain_xxx |
/mcp, /v1/* |
The key identifies one brain. A missing or malformed key returns 401; an unknown, expired, revoked or suspended key also returns 401. |
| Admin token | Authorization: Bearer <admin-token> |
/admin/api/spongram/*, /metrics |
The value of SPONGRAM_ADMIN_TOKEN, compared in constant time. Not accepted when the Cloud control plane is enabled. |
| Console session | Cookie spongram_cloud_session plus X-CSRF-Token on every non-GET request |
/console/api/*, /admin/api/spongram/* with the Cloud control plane |
Non-GET requests must also carry an Origin header equal to SPONGRAM_PUBLIC_URL. |
| Internal token | Authorization: Bearer <internal-token> |
/_internal/* |
The value of SPONGRAM_INTERNAL_AUTH_TOKEN. Used by graphiti-mcp and the background workers, never by clients. |
Every brain-key request except the MCP handshake consumes one token of a per-brain rate limit (SPONGRAM_RATE_LIMIT_PER_MIN, default 100, 0 disables it). An exhausted bucket returns 429 with a Retry-After header. The desktop edition is never rate limited.
With the Cloud control plane the admin token no longer opens the admin API. It is only accepted as installation credential: by POST /console/api/auth/setup, which creates the first administrator, and by POST /console/api/auth/recovery, which opens a 30-minute recovery session.
Public routes¶
These routes need no credentials.
| Method | Path | Purpose | Notable behaviour |
|---|---|---|---|
GET |
/readyz |
Readiness probe | 200 when the three hard dependencies answer (upstream Graphiti, PostgreSQL, Neo4j), 503 otherwise. Ignores background workers. Use it for container healthchecks. |
GET, HEAD |
/healthz, /health |
Diagnostic probe | Reports version, edition, each dependency, the Sleeper and Dream worker states, the ingestion queue depth and the parked count. Returns 503 when a dependency is down, when a worker is stalled, or, on a server, when the Sleeper or Dream worker is not enabled (not_configured). |
GET |
/admin/api/spongram/marketplace.json |
Claude Code plugin marketplace descriptor | Static descriptor with an empty plugins list; it reveals no brain. Unrelated to the persona marketplace. |
GET, HEAD |
/documentation/ |
This documentation site | Mounted only when the built site is present in the image (SPONGRAM_DOCS_DIST_DIR). /documentation redirects to /documentation/. |
GET |
/docs, /redoc, /openapi.json |
FastAPI interactive API documentation | See OpenAPI. |
GET |
/admin/, /admin/{path} |
Admin single-page application | Static files; every data call it makes is authenticated. Mounted when the built SPA is present (SPONGRAM_ADMIN_DIST_DIR). |
GET, HEAD |
/downloads/{path} |
Files of the downloads directory | Mounted when SPONGRAM_DOWNLOADS_DIR exists. |
GET, HEAD |
/, /fr/, /en/, /{lang}/{page}/ |
Product landing site | Mounted only when a landing build is present in the image (SPONGRAM_LANDING_DIST_DIR). / redirects to /fr/ or /en/ according to Accept-Language. |
GET |
/static/marketplace/{source}/{article_id}.webp |
Avatar of a persona-marketplace article | Mounted only with the persona marketplace. Serves only the .webp of a catalogued article. |
GET |
/v1/graph, /v1/wiki, /v1/codemap, /v1/personas |
HTML shells of the explorers | The page itself carries no data. It asks for the brain key in the browser and sends it as a header on every data call. /v1/personas returns 404 unless SPONGRAM_PERSONAS_ENABLED is on. ?lang=fr or ?lang=en selects the interface language. |
Use /readyz, not /healthz, for healthchecks
/healthz returns 503 when a background worker is stalled or not enabled, even though the service can still serve requests. A container healthcheck wired to it restarts a working service for a reason unrelated to its ability to answer. /readyz only judges the three dependencies the service cannot work without.
/metrics (Prometheus exposition) is not public: it requires the admin token. With the Cloud control plane the admin token is not accepted there and a console session is refused with 403, so the endpoint cannot be scraped. See observability.
Brain-key routes¶
All routes below require Authorization: Bearer spt_brain_xxx. The brain is always taken from the key; no route accepts a group_id from the client, and POST /v1/codemap/ingest rejects a body whose group_id differs from the key's brain with 403.
With the Cloud control plane, a brain whose access_mode is enforce also checks the key's permissions (403 with permission_denied otherwise). Brains in another access mode are not subject to these checks.
| Request | Permission |
|---|---|
GET on /v1/info, /v1/graph, /v1/wiki, /v1/codemap, /v1/personas |
memory.read |
Any path ending in /full, /card or export.zip |
memory.export |
Any DELETE |
memory.delete |
POST ending in /ingest, /import or /import-card |
memory.import |
Other writes under /v1/personas and /v1/codemap |
brain.configure |
POST /v1/memory/distill |
memory.write |
Brain information¶
| Method | Path | Purpose |
|---|---|---|
GET |
/v1/info |
Brain identity (instance_id, group_id, display_name, status), the models in use and live counters (episodes_count, nodes_count, edges_count, token totals, last_episode_at). Graph counters are null when Neo4j cannot be reached. |
Graph explorer (Cortex)¶
| Method | Path | Purpose | Notable behaviour |
|---|---|---|---|
GET |
/v1/graph/data/stats |
Node, edge and episode counts | |
GET |
/v1/graph/data/search |
Entity search by name | q (1 to 200 characters), limit (1 to 200, default 20). |
GET |
/v1/graph/data/node/{uuid} |
One node with up to 50 neighbours | 404 when the node is not in this brain. |
GET |
/v1/graph/data/episodes |
Recent episodes | limit (1 to 500), optional project and persona filters. With project aliases enabled, project also matches the aliases of that project. |
GET |
/v1/graph/data/full |
Entity subgraph for the 3D view | limit (1 to 2000, default 500), offset, optional label and project. |
GET |
/v1/graph/data/labels |
Entity types present in the brain | |
GET |
/v1/graph/data/projects |
Project tags present in the brain | |
GET |
/v1/graph/data/entity/{uuid}/summary |
Sleeper summary of an entity | Returns {"available": false} until the Sleeper has processed the entity. |
DELETE |
/v1/graph/data/entity/{uuid} |
Forget an entity | Deletes the entity node, its relationships and its summary. Episodes are kept. 404 when the entity is not in this brain. |
GET |
/v1/graph/stream |
Server-sent events: new nodes and episodes, plus search activity when the Cortex activity bus is on | Must be read with fetch() and a stream reader, because the key travels in the Authorization header. |
Wiki¶
| Method | Path | Purpose | Notable behaviour |
|---|---|---|---|
GET |
/v1/wiki/index.json |
List of compiled wiki pages | |
GET |
/v1/wiki/themes.json |
Communities of entities, with member previews | limit (1 to 100, default 20). 503 when the graph driver is not available. |
GET |
/v1/wiki/{slug} |
One page as text/markdown |
404 for an unknown slug. |
GET |
/v1/wiki/export.zip |
All pages in one ZIP archive | Files are placed under spongram/{slug}.md. |
Code map¶
| Method | Path | Purpose | Notable behaviour |
|---|---|---|---|
POST |
/v1/codemap/ingest |
Upload the code graph of one repository | Body: repo, nodes[], edges[], optional pruned_files[]. 422 when one is missing. Ingests of the same repository into the same brain are serialised. |
GET |
/v1/codemap/data/stats |
Brain identity and code-map counters | |
GET |
/v1/codemap/data/minimap |
Compact text summary of the map, read by the Claude Code session-start hook | Returns an empty text when no map exists. |
GET |
/v1/codemap/data/full |
Code graph for the 3D view | Optional project (one repository) and label (one node kind). |
GET |
/v1/codemap/data/search |
Search code nodes | |
GET |
/v1/codemap/data/projects |
Indexed repositories with their node counts | |
GET |
/v1/codemap/data/labels |
Node kinds with their counts | |
GET |
/v1/codemap/data/episodes |
Always an empty list: the code map holds no episodes | Present so the shared explorer page works unchanged. |
GET |
/v1/codemap/data/node/{uuid} |
One code node with its neighbourhood |
See code map.
Personas¶
Mounted in every edition; every route returns 404 while SPONGRAM_PERSONAS_ENABLED is off. No route activates a persona: activation is done by the agent through the activate_persona MCP tool. See personas.
| Method | Path | Purpose | Notable behaviour |
|---|---|---|---|
GET |
/v1/personas/data/active |
Active persona and the instruction block rendered for it | variant=full (default) or variant=code. |
GET |
/v1/personas/data/personas |
List personas | |
GET |
/v1/personas/data/personas/{slug} |
One persona | 404 for an unknown slug. |
POST |
/v1/personas/data/personas |
Create a persona | 201. |
PUT |
/v1/personas/data/personas/{slug} |
Update a persona | |
DELETE |
/v1/personas/data/personas/{slug} |
Delete a persona | 204. |
POST |
/v1/personas/data/personas/import-card |
Import a Character Card V2 | JSON body only, 128 KiB at most; no URL is fetched. |
GET |
/v1/personas/data/personas/{slug}/card |
Export a persona as a Character Card V2 | |
GET |
/v1/personas/data/skills |
List persona skills | |
GET |
/v1/personas/data/skills/{slug} |
One skill with its body | |
POST |
/v1/personas/data/skills |
Create a skill from a SKILL.md body |
201. Body limited to 32 KiB. |
PUT |
/v1/personas/data/skills/{slug} |
Update a skill | 422 when the name of the front matter differs from the slug. |
DELETE |
/v1/personas/data/skills/{slug} |
Delete a skill | 204. |
POST |
/v1/personas/data/skills/import |
Import a SKILL.md from a URL |
https:// only, 32 KiB at most, 3 redirects at most, each of them https://. 422 otherwise. |
Memory capture¶
| Method | Path | Purpose | Notable behaviour |
|---|---|---|---|
POST |
/v1/memory/distill |
Extract durable facts from the tail of a conversation transcript and queue them as episodes | 503 while SPONGRAM_DISTILL_ENABLED is off (the default). source must be precompact or sessionend (400 otherwise). Returns {"queued": n, "facts": [...]}. Called by the Claude Code plugin hooks. |
Admin API¶
All paths below are relative to /admin/api/spongram. Every route requires the admin token, unless the Cloud control plane is enabled. {id} is the numeric instance id.
With the Cloud control plane the same routes are authorised by the console session: each route maps to one permission checked against the caller's grant on the target brain, as shown in the last column. Routes marked replaced answer 403 there, because the control plane API provides the equivalent. Routes marked installation administrator require a platform administrator account.
Instances¶
| Method | Path | Purpose | Notable behaviour | Cloud control plane |
|---|---|---|---|---|
GET |
/instances |
List brains with live graph counters | Counters come from Neo4j; a Neo4j failure degrades to stored values. | Any session; only brains the user may read |
POST |
/instances |
Create a brain and its key | Body: owner_email, display_name, optional language (default fr), llm_model_slug, embedder_slug, embedding_dim. The response carries api_key in clear text once. |
Replaced |
GET |
/instances/{id} |
One brain with counters | 404 for an unknown id. |
memory.read |
PATCH |
/instances/{id} |
Change display_name, language, status (active, suspended, purged) or wiki_enabled |
A suspended brain's key is refused with 401. |
brain.configure; changing status also needs access.manage |
DELETE |
/instances/{id} |
Delete the brain, its key and its graph | 204. The SQL delete and the graph purge succeed or fail together; a failed purge returns 500 and leaves the brain intact. |
memory.delete + brain.configure + access.manage; may answer 202 with state: purge_pending |
POST |
/instances/{id}/regenerate-key |
Issue a new brain key | The previous key is revoked immediately. The new key is returned once. | Replaced |
Bundles and brain transfer¶
| Method | Path | Purpose | Notable behaviour | Cloud control plane |
|---|---|---|---|---|
GET |
/instances/{id}/bundle/{kind} |
Download a client bundle | kind is desktop.mcpb or claude-code.plugin (404 otherwise). The header X-Spongram-Brain-Key must carry the brain key in clear text, because the server only stores its hash; 403 when it does not match the brain or the key is revoked or expired. |
memory.read |
GET |
/instances/{id}/brain/export |
Export the brain as a spongram-brain/v1 JSON attachment |
Includes personas, skills and project aliases when those features are on. 503 when the graph driver is not available. |
memory.export |
POST |
/instances/{id}/brain/import |
Replay an export into the brain through the ingestion queue | 413 above 100 MB, 409 when the brain is not active, 400 for an invalid file or a different embedding dimension. Entities and facts are re-extracted from the episodes, not copied. Never activates a persona. |
memory.import + brain.configure + memory.write |
Purge and forgetting¶
| Method | Path | Purpose | Notable behaviour | Cloud control plane |
|---|---|---|---|---|
POST |
/instances/{id}/purge |
Erase the brain's graph, wiki pages and counters | Keeps the instance and its key. Returns deleted_nodes, deleted_rels, deleted_wiki_pages. Without the Cloud control plane, see the note below. |
memory.delete + brain.configure + access.manage |
POST |
/orphans/{group_id}/purge |
Erase a graph namespace whose instance no longer exists | 400 unless group_id starts with sb_; 409 when an instance still uses it. |
Replaced |
DELETE |
/instances/{id}/forget/fact/{edge_uuid} |
Mark one fact as forgotten and record an audit node | Optional reason query parameter. Answers tombstoned: false both for an unknown fact and for a fact of another brain. |
memory.delete |
GET |
/instances/{id}/forget/log |
Audit list of forgotten facts | limit 1 to 500, default 100. |
audit.read + memory.read |
DELETE |
/instances/{id}/codemap/{repo} |
Delete every code-map node of one repository | Returns deleted: 0 for an unknown repository. Not mounted on desktop. |
memory.delete |
Purge and the ingestion queue
On a server without the Cloud control plane, POST /instances/{id}/purge does not retire the brain's rows in the ingestion queue. The reconciler queues again any completed episode of the last 30 days that it no longer finds in the graph, so recently stored episodes can be ingested again after a purge. The MCP tool clear_graph retires the queue rows together with the graph, and deleting the brain removes them. With the Cloud control plane the purge retires the queued work itself.
Ingestion queue¶
Not mounted on desktop. These routes never delete a row. See ingestion.
| Method | Path | Purpose | Notable behaviour | Cloud control plane |
|---|---|---|---|---|
GET |
/instances/{id}/ingestion |
Queue counters and the rows that are retrying or parked | Returns counts (including completed_24h), parked_threshold and rows. |
operations.read |
POST |
/instances/{id}/ingestion/replay-all |
Make every waiting row due now | Returns replayed. |
operations.retry |
POST |
/instances/{id}/ingestion/{row_id}/replay |
Make one row due now | 409 when the row is being processed. |
operations.retry |
POST |
/instances/{id}/ingestion/{row_id}/retire |
Withdraw one row from the queue on purpose | Body: reason (required, recorded on the row). Accepts a pending or completed row; 409 for a processing or already retired row. The row stays in the table. |
memory.delete |
Maintenance¶
Not mounted on desktop. All three default to a dry run.
| Method | Path | Purpose | Notable behaviour | Cloud control plane |
|---|---|---|---|---|
POST |
/instances/{id}/episodes/backfill-client-tag |
Add a client= tag to episodes that have none |
dry_run=true by default: report only (by_client, up to 20 samples). With dry_run=false, read updated for what was written. Replaying it changes nothing. |
memory.correct |
POST |
/instances/{id}/episodes/backfill-project-tag |
Give a project= tag to episodes that have none |
Without a body it lists candidates (500 at most). Body: project, optional uuids. dry_run=false requires project (422 otherwise). Never changes an episode that already has a project. |
memory.correct |
POST |
/instances/{id}/normalize |
Apply entity normalisation rules to the brain | dry_run=true by default: returns the proposed actions (first 50 in preview). |
memory.correct |
Explorer mirrors¶
The admin UI embeds the explorers of any brain without its key. The HTML shells are plain pages; the admin token travels in the URL fragment (#admin=), which browsers never send to the server, and every data call then carries it in the Authorization header.
| Method | Path | Purpose | Cloud control plane |
|---|---|---|---|
GET |
/instances/{id}/cortex, /instances/{id}/wiki, /instances/{id}/codemap, /instances/{id}/personas |
HTML shells of the mirrors | memory.read |
GET |
/instances/{id}/cortex/data/*, /instances/{id}/cortex/stream |
Same data as /v1/graph/data/* and /v1/graph/stream |
memory.read |
DELETE |
/instances/{id}/cortex/data/entity/{uuid} |
Forget an entity | memory.delete |
GET |
/instances/{id}/wiki/index.json, /themes.json, /export.zip, /{slug} |
Same data as /v1/wiki/* |
memory.read (memory.export for the archive) |
GET |
/instances/{id}/codemap/data/* |
Same data as /v1/codemap/data/* |
memory.read |
GET, POST, PUT, DELETE |
/instances/{id}/personas/data/* |
Same routes as /v1/personas/data/* |
memory.read to read, brain.configure to write, memory.import + brain.configure to import, memory.export to export a card |
GET |
/instances/{id}/personas/summary |
Read-only persona summary of a brain: active persona, activation counts, skill counts, limits |
memory.read |
The mirrors have no persona activation route either.
Persona marketplace¶
Mounted only on a server with SPONGRAM_MARKETPLACE_ENABLED and SPONGRAM_PERSONAS_ENABLED on. Call GET /features first: when it answers marketplace: false, these routes do not exist. See persona marketplace.
| Method | Path | Purpose | Notable behaviour | Cloud control plane |
|---|---|---|---|---|
GET |
/marketplace |
Catalogue: sources, counts and articles | Installation administrator, or any user with brain.configure on a brain |
|
GET |
/marketplace/state?instance_id={id} |
Which articles are installed in a brain | memory.read |
|
POST |
/marketplace/reload |
Re-read the source directories | Returns errors for skipped articles. No restart needed. |
Installation administrator |
GET |
/marketplace/{source}/{article_id} |
One article: manifest, card, skills and rendered block | 404 for an unknown article. |
Same as the catalogue |
POST |
/marketplace/{source}/{article_id}/install |
Install a persona and its skills into a brain | Body: instance_id, replace (default false). 201 on success. 409 with the conflicting slug when the persona exists and replace is false. 422 when a per-brain limit is reached. Never activates the persona. |
brain.configure |
Settings, features and activity¶
| Method | Path | Purpose | Notable behaviour | Cloud control plane |
|---|---|---|---|---|
GET |
/features |
Feature flags the UI needs: personas, marketplace |
Any session | |
GET |
/settings/inference |
Current inference configuration and the provider presets | The API key is never returned; the response says whether one is set. | Installation administrator |
PUT |
/settings/inference |
Change provider, base URL, API key, models, Sleeper tuning | Takes effect on the next request, without restart. Changing embedder_model or embedder_dim returns 409 (embedder_change_requires_purge) unless purge_acknowledged is true. |
Installation administrator |
POST |
/settings/inference/test |
Probe a candidate configuration without saving it | Runs three checks: chat completion, tool calls, strict JSON schema. Uses the stored API key when none is sent. | Installation administrator |
GET |
/tokens |
Token counters by role since the last start | In-memory, not persisted. | Installation administrator |
GET |
/instances/usage/summary |
Requests per brain over the last 24 hours | Any session; only brains with usage.read |
|
GET |
/instances/{id}/usage |
Time series, totals and per-tool breakdown | bucket is hour or day (400 otherwise); window_hours 1 to 2160. |
usage.read |
GET |
/instances/{id}/activity |
Live counters: episodes, queue, Sleeper, Dream, circuit breakers, cache | Designed to be polled. | operations.read |
See inference providers for the settings themselves.
Cloud control plane API¶
Mounted only with SPONGRAM_CLOUD_CONTROL_ENABLED=true. /console and /console/{path} redirect to the admin UI under /admin/. The routes below are authenticated by the console session unless stated otherwise.
Sessions (/console/api/auth)¶
| Method | Path | Purpose |
|---|---|---|
GET |
/options |
Which sign-in methods are available (password, setup when no administrator exists yet, oidc). Public. |
POST |
/setup |
Create the first installation administrator. The body must carry the admin token; answers 409 once an administrator exists. |
POST |
/login |
Sign in with a username and password. Public, throttled. |
GET |
/login, /callback |
OpenID Connect sign-in, when SPONGRAM_CLOUD_OIDC_ISSUER and SPONGRAM_CLOUD_OIDC_CLIENT_ID are set. |
POST |
/recovery |
Open a 30-minute recovery session with the admin token. |
GET |
/session |
Current session, including the CSRF token. |
POST |
/password |
Change the current password. |
POST |
/logout |
End the session. |
Control plane (/console/api)¶
| Method | Path | Purpose |
|---|---|---|
GET |
/config |
Product name and console configuration. Public. |
GET |
/me/brains |
Brains the current user can reach, with permissions. |
GET, POST |
/orgs |
List the organisations of the user; create one (installation administrator). |
PATCH |
/orgs/{org} |
Suspend or reactivate an organisation (installation administrator). |
GET, POST |
/orgs/{org}/brains |
List or create brains of an organisation. A brain is created in chat or workflow mode. |
PATCH |
/orgs/{org}/brains/{brain} |
Suspend or reactivate a brain. |
GET, POST |
/orgs/{org}/principals |
List or add members (human) and applications (service), with an organisation role member, admin or owner. |
PATCH |
/orgs/{org}/principals/{principal_id} |
Suspend or reactivate a member or application. |
GET |
/orgs/{org}/accounts |
User accounts of an organisation. |
POST |
/accounts |
Create a user account with a temporary password, optionally with a brain and a role on it. |
POST |
/users |
Register a user identified by an OpenID Connect issuer and subject (installation administrator). |
PATCH |
/users/{user_id} |
Suspend or reactivate a user. |
GET |
/users |
All users (installation administrator). |
POST |
/orgs/{org}/accounts/{user_id}/password, /accounts/{user_id}/password |
Reset a password. |
GET |
/brains/{brain}/access |
Grants on a brain. |
PUT |
/brains/{brain}/grants |
Grant permissions on a brain to a member or service account. |
DELETE |
/brains/{brain}/grants/{principal} |
Remove a grant. The keys that principal holds on the brain are revoked in the same transaction. |
GET, POST |
/brains/{brain}/keys |
List or issue brain keys. A key is shown once. |
POST |
/keys/{key_id}/revoke |
Revoke a key. |
GET, PATCH |
/brains/{brain}/policy |
Read or change a brain's write policy (approval_required). |
PUT |
/orgs/{org}/allocations |
Set capacity allocations for an organisation (installation administrator). |
GET |
/orgs/{org}/license, /orgs/{org}/audit |
Licence status and audit log of an organisation. |
GET |
/deployment |
Installation and licence status (installation administrator). |
POST |
/deployment/license/preview, /deployment/license/activate |
Check or activate a licence (installation administrator). |
GET |
/platform/inventory |
Installation inventory (installation administrator). |
POST |
/platform/migrations/preview, /platform/migrations/runs, /platform/migrations/cancel-drain |
Preview, apply or cancel the migration of existing brains to Cloud access control (installation administrator). |
Here {brain} is the brain's public identifier (a UUID), not the numeric instance id.
Workflow memory (/v1)¶
These routes accept either a brain key or a console session. With a brain key, {brain} must be the public identifier of the key's own brain; any other value returns 404.
| Method | Path | Purpose |
|---|---|---|
GET |
/v1/me, /v1/brains |
Identity of the caller and the brains it can reach. |
POST |
/v1/brains/{brain}/memories |
Submit a source for ingestion (202). |
POST |
/v1/brains/{brain}/memories/{source}/revisions |
Submit a new revision of a source (202). |
GET |
/v1/brains/{brain}/operations, /operations/{operation_id} |
Follow ingestion operations. |
POST |
/v1/brains/{brain}/operations/{operation_id}/retry |
Retry an operation. |
POST |
/v1/brains/{brain}/search |
Search approved sources. |
GET |
/v1/brains/{brain}/sources, /sources/{source}/revisions |
List sources and their revisions. |
DELETE |
/v1/brains/{brain}/sources/{source} |
Withdraw a source (202). |
GET, PUT |
/v1/brains/{brain}/schemas, /schemas/{name}/{version} |
List or register memory schemas. |
GET |
/v1/brains/{brain}/usage, /explore |
Usage and graph exploration. |
GET |
/v1/brains/{brain}/export |
Export sources. |
POST |
/v1/brains/{brain}/restore |
Restore sources (202). |
Desktop-only routes¶
Mounted only with SPONGRAM_EDITION=local, on the loopback address, without a key.
| Method | Path | Purpose |
|---|---|---|
GET, PUT |
/v1/settings/inference |
Read or change the local inference configuration. |
GET |
/v1/settings/models |
Models available on the local inference engine. |
GET, PUT |
/v1/settings/license |
Licence lock state pushed by the desktop application. |
GET |
/v1/bundle/{kind} |
Download desktop.mcpb or claude-code.plugin for the local brain. |
GET, POST |
/v1/brain/export, /v1/brain/import |
Export or import the local brain. |
POST |
/shutdown |
Graceful stop requested by the desktop application. Returns 404 on a server. |
Internal routes¶
/_internal/v1/{role}/chat/completions and /_internal/v1/{role}/embeddings are the inference proxy that graphiti-mcp and the background workers call; /_internal/cloud/execution belongs to the Cloud control plane. They require the internal token (and answer 503 while SPONGRAM_INTERNAL_AUTH_TOKEN is not set) and are not part of the client API. Do not route them through a public reverse proxy.
Examples¶
List the brains of a server:
curl -s https://spongram.example.com/admin/api/spongram/instances \
-H "Authorization: Bearer <admin-token>"
Create a brain. The api_key field of the answer is the only time the key is shown:
curl -s -X POST https://spongram.example.com/admin/api/spongram/instances \
-H "Authorization: Bearer <admin-token>" \
-H "Content-Type: application/json" \
-d '{"owner_email": "alice@example.com", "display_name": "Alice", "language": "en"}'
Read a brain's status with its own key:
Preview a project-tag backfill without writing anything:
curl -s -X POST \
"https://spongram.example.com/admin/api/spongram/instances/1/episodes/backfill-project-tag" \
-H "Authorization: Bearer <admin-token>"
OpenAPI¶
The application is created with FastAPI's default settings, so the interactive Swagger UI is served at /docs, ReDoc at /redoc and the schema at /openapi.json, without authentication. The schema covers the JSON routes; the HTML shells, the SSE streams, the probes other than /healthz, /metrics and the internal routes are excluded from it. The product documentation lives under /documentation/ for that reason.