API reference

Authenticate and automate Next Wiki over its REST API.

REST API

Next Wiki ships a REST API to read and write everything in your workspace — documents, collections, tags, members and more. Every route lives under /api on your instance.

Base URL: https://YOUR-WIKI/api — replace YOUR-WIKI with your host (e.g. https://wiki.yourcompany.com).

Authentication

All requests authenticate with a personal API key. Create one in Settings → API (or POST /api/chaves). The key is shown once and starts with nwk_.

Send it on every request, in either header:

curl https://YOUR-WIKI/api/workspaces \
  -H "X-Api-Key: nwk_your_token"

# or
curl https://YOUR-WIKI/api/workspaces \
  -H "Authorization: Bearer nwk_your_token"

Scopes. A key can be unrestricted (full access, with the owner’s permissions) or limited to scopes:

ScopeGrants
docs:lerread documents and metadata
docs:escrevercreate and update documents

Documents

MethodPathDescription
GET/documentos/{id}Get a document (metadata + markdown)
POST/documentosCreate a document
PUT/documentos/{id}/conteudoSave markdown (title/content)
PATCH/documentos/{id}/renomearRename
PATCH/documentos/{id}/moverMove to another collection
PATCH/documentos/{id}/tipoSet document type
PUT/documentos/{id}/tagsSet tags
POST/documentos/{id}/publicarCreate a public link
POST/documentos/{id}/despublicarRemove the public link
GET/documentos/{id}/comentariosList comments
POST/documentos/{id}/comentariosAdd a comment
GET/documentos/{id}/versoesList versions
GET/documentos/{id}/versoes/{n}Get a version
POST/documentos/{id}/versoes/{n}/restaurarRestore a version
POST/documentos/{id}/arquivarArchive
POST/documentos/{id}/restaurarRestore from trash
DELETE/documentos/{id}Delete permanently

Collections

MethodPathDescription
GET/colecoes/{id}Get a collection
GET/colecoes/{id}/documentosList documents in it
POST/colecoesCreate a collection
PATCH/colecoes/{id}Update
DELETE/colecoes/{id}Delete
GET PUT/colecoes/{id}/permissoesRead/write permissions (owner)
MethodPathDescription
GET/workspacesList workspaces
GET/workspaces/{id}Get a workspace
POST/workspacesCreate a workspace
GET/workspaces/{id}/arvoreTree (collections + documents)
GET/workspaces/{id}/busca?q=Full-text search
GET/workspaces/{id}/busca-semantica?q=Semantic search (if enabled)
GET/workspaces/{id}/lixeiraTrash (archived documents)

Tags & favorites

MethodPathDescription
GET POST/workspaces/{wid}/tagsList / create tags
DELETE/workspaces/{wid}/tags/{id}Delete a tag
GET/favoritosList the user’s favorite documents

Members & groups

MethodPathDescription
GET/workspaces/{wid}/membrosList members
POST/workspaces/{wid}/convitesInvite someone
GET POST/workspaces/{wid}/gruposList / create groups
PUT DELETE/grupos/{id}Update / delete a group
POST DELETE/grupos/{id}/membros/{userId}Add / remove group member

Webhooks

Subscribe to events and receive a signed POST on each change.

MethodPathDescription
GET/webhooks/eventosCatalog of available events
GET POST/workspaces/{wid}/webhooksList / create a webhook
PUT DELETE/webhooks/{id}Update / delete
GET/webhooks/{id}/entregasLast deliveries (log)
POST/webhooks/{id}/testarSend a test event

Events: documents.create|update|move|publish|unpublish|archive|unarchive|delete, collections.create|update|delete, comments.create, members.invite, or * for all.

Signature. Each delivery is signed (HMAC-SHA256) in the header NextWiki-Signature: t=<unix>,s=<hex>, where the signed payload is "<unix>.<body>". The event also comes in NextWiki-Event.

API keys

MethodPathDescription
GET/chavesList your keys
POST/chavesCreate a key (returns the token once)
PATCH/chaves/{id}/renomearRename
POST/chaves/{id}/revogarRevoke
DELETE/chaves/{id}Delete

Want an AI agent or IDE to read and edit the wiki? See the MCP server.