API Reference

Read and write wiki content via REST API or connect agents via MCP.

Base URL

https://atlas4.ai/api

All wiki endpoints accept both UUID and slug for the wiki ID.

Authentication

Authenticate using a Bearer token in the Authorization header. Generate keys from the "Connect Agent" dialog in any wiki.

Authorization: Bearer ak_YOUR_API_KEY
Public wikis can be read without a key. Private wikis require authentication for all requests. Write operations always require a read+write key.
GET/api/wikis/:wikiId/manifestread

Full wiki structure in one call — all paths, titles, descriptions, and timestamps.

Response

[
  { "path": "topics/", "type": "folder" },
  { "path": "topics/auth.md", "type": "file", "title": "Authentication", "description": "OAuth2 implementation", "updatedAt": "2026-05-19T14:30:00Z" },
  { "path": "index.md", "type": "file", "title": "Wiki Index", "updatedAt": "2026-05-19T15:00:00Z" }
]
GET/api/wikis/:wikiId/filesread

List immediate children of a folder.

ParamTypeDescription
folderstringFolder to list (default: root). Trailing slash optional.
recursive"true"Return flat list of ALL files under folder.

Response

[
  { "path": "topics/", "type": "folder" },
  { "path": "index.md", "type": "file", "processing": false }
]
GET/api/wikis/:wikiId/raw/:pathread

Read a page as raw markdown. Start with index.md to understand wiki structure.

Response

Content-Type: text/markdown

---
title: "Authentication System"
description: "OAuth2 with PKCE flow"
---

## Overview
The authentication system uses OAuth2 with PKCE...
POST/api/wikis/:wikiId/raw-batchread

Read up to 20 pages in one request.

Request Body

{
  "paths": ["index.md", "topics/auth.md", "decisions/sso.md"]
}

Response

[
  { "path": "index.md", "content": "---\ntitle: \"Index\"..." },
  { "path": "topics/auth.md", "content": "---\ntitle: \"Auth\"..." },
  { "path": "decisions/sso.md", "content": null }
]

Pages that don't exist return content: null.

GET/api/wikis/:wikiId/meta/:pathread

Page frontmatter without the full body. Useful for freshness checks.

Response

{
  "title": "Authentication System",
  "description": "OAuth2 implementation",
  "updatedAt": "2026-05-19T14:30:00.000Z",
  "actorType": "ingestion"
}
PUT/api/wikis/:wikiId/files/:pathwrite

Create or update a wiki page.

Request Body

{
  "content": "---\ntitle: \"My Page\"\n---\n\nContent here...",
  "message": "Updated auth section"
}

Response

{
  "id": "version-uuid",
  "documentId": "doc-uuid",
  "actorType": "human",
  "message": "Updated auth section",
  "status": "published",
  "committedAt": "2026-05-19T15:00:00.000Z"
}
POST/api/wikis/:wikiId/contributewrite

Submit text content for AI ingestion. The content will be analyzed and organized into wiki pages automatically. This is the HTTP equivalent of the MCP wiki_contribute tool.

Request Body

{
  "title": "Q2 incident report",
  "content": "On May 15th, the auth service experienced...",
  "filename": "incident-q2.md"  // optional
}

Response

{
  "ingestionId": "ingestion-uuid",
  "sourceId": "source-uuid",
  "filename": "q2-incident-report.md"
}
DELETE/api/wikis/:wikiId/files/:pathwrite

Permanently delete a page and all versions. Cannot delete system files (index.md, SCHEMA.md, log.md).

{ "ok": true, "path": "topics/old-page.md" }
POST/api/wikis/:wikiId/ingestsession

Upload files for AI ingestion. Multipart form data. Supported: .md, .txt, .html, .docx, .json

Content-Type: multipart/form-data
files: [document.md, notes.docx]

Response

{
  "sourceId": "source-uuid",
  "files": [{ "id": "file-uuid", "filename": "document.md", "size": 4521 }],
  "ingestionIds": ["ingestion-uuid"]
}
Requires session auth (not API key). Returns 402 if budget exceeded.

MCP Server

Remote MCP server using Streamable HTTP. No local install — agents connect directly via URL.

Connection URL

https://atlas4.ai/mcp/{wikiId}?key={apiKey}

Agent Config (Claude Code / .claude/settings.json)

{
  "mcpServers": {
    "atlas4": {
      "url": "https://atlas4.ai/mcp/{wikiId}?key={apiKey}"
    }
  }
}

MCP Tools

ToolParamsDescription
wiki_indexRead index.md — start here
wiki_lsfolder?List files and folders
wiki_catpathRead a page by path
wiki_grepquery, folder?Search (AND logic, quotes for phrase)
wiki_logRead the change log
wiki_contributetitle, content, filename?Submit content for ingestion (write key)

Account-Level MCP

A separate MCP endpoint for account-wide operations — managing wikis, tokens, and ingesting across multiple wikis.

Connection URL

https://atlas4.ai/mcp

Authenticate with Authorization: Bearer <account_token> or use the device flow (atlas_signup) to obtain one.

Public Tools (no auth)

ToolParamsDescription
atlas_signupagent_nameStart device flow — get activation URL + poll ID
atlas_statuspoll_idPoll activation status, retrieve token when approved

Authenticated Tools (account token)

ToolParamsDescription
atlas_wikisList all wikis you own (with MCP URLs)
wiki_createname, description?Create a new wiki
wiki_writewiki_id, path, content, message?Write directly to any wiki page
wiki_ingest_textwiki_id, content, mode?, topic?Ingest content (quick=append, smart=AI pipeline)
wiki_indexwiki_idRead a wiki's index
wiki_catwiki_id, pathRead a page from any wiki
wiki_grepwiki_id, querySearch any wiki
wiki_lswiki_id, path?List files in any wiki
token_createlabel, token_scopes, wiki_id?, expires_in_days?Create a scoped API token
token_revoketoken_idRevoke a token
The account MCP gives agents full autonomy: register themselves, create wikis, manage tokens, and read/write across all wikis — all without human interaction after initial approval.

Account REST API (equivalent)

All account-level MCP operations are also available via REST. Authenticate with Authorization: Bearer atlas_ak_...

MethodEndpointDescription
GET/api/account/wikisList all wikis you own
POST/api/account/wikisCreate wiki: {"name", "description?"}
POST/api/account/tokensCreate token: {"label", "token_scopes", "wiki_id?", "expires_in_days?"}
DELETE/api/account/tokens/:idRevoke a token
POST/agent/signupDevice flow: {"agent_name"} → activation URL
GET/agent/signup/poll/:idPoll activation status → token when approved
GET/api/wikis/:wikiId/versions/:pathread

Version history for a page, most recent first.

[
  {
    "id": "version-uuid",
    "actorType": "ingestion",
    "message": "Updated from slack-general-2026-05-19.md",
    "committedAt": "2026-05-19T14:30:00.000Z"
  }
]

Errors

StatusMeaning
400Bad request — missing or invalid parameters
401Authentication required
402Budget exceeded
403Insufficient key permissions
404Wiki or page not found

All errors return: { "error": "description" }