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:
| Scope | Grants |
|---|---|
docs:ler | read documents and metadata |
docs:escrever | create and update documents |
Documents
| Method | Path | Description |
|---|---|---|
GET | /documentos/{id} | Get a document (metadata + markdown) |
POST | /documentos | Create a document |
PUT | /documentos/{id}/conteudo | Save markdown (title/content) |
PATCH | /documentos/{id}/renomear | Rename |
PATCH | /documentos/{id}/mover | Move to another collection |
PATCH | /documentos/{id}/tipo | Set document type |
PUT | /documentos/{id}/tags | Set tags |
POST | /documentos/{id}/publicar | Create a public link |
POST | /documentos/{id}/despublicar | Remove the public link |
GET | /documentos/{id}/comentarios | List comments |
POST | /documentos/{id}/comentarios | Add a comment |
GET | /documentos/{id}/versoes | List versions |
GET | /documentos/{id}/versoes/{n} | Get a version |
POST | /documentos/{id}/versoes/{n}/restaurar | Restore a version |
POST | /documentos/{id}/arquivar | Archive |
POST | /documentos/{id}/restaurar | Restore from trash |
DELETE | /documentos/{id} | Delete permanently |
Collections
| Method | Path | Description |
|---|---|---|
GET | /colecoes/{id} | Get a collection |
GET | /colecoes/{id}/documentos | List documents in it |
POST | /colecoes | Create a collection |
PATCH | /colecoes/{id} | Update |
DELETE | /colecoes/{id} | Delete |
GET PUT | /colecoes/{id}/permissoes | Read/write permissions (owner) |
Workspaces & search
| Method | Path | Description |
|---|---|---|
GET | /workspaces | List workspaces |
GET | /workspaces/{id} | Get a workspace |
POST | /workspaces | Create a workspace |
GET | /workspaces/{id}/arvore | Tree (collections + documents) |
GET | /workspaces/{id}/busca?q= | Full-text search |
GET | /workspaces/{id}/busca-semantica?q= | Semantic search (if enabled) |
GET | /workspaces/{id}/lixeira | Trash (archived documents) |
Tags & favorites
| Method | Path | Description |
|---|---|---|
GET POST | /workspaces/{wid}/tags | List / create tags |
DELETE | /workspaces/{wid}/tags/{id} | Delete a tag |
GET | /favoritos | List the user’s favorite documents |
Members & groups
| Method | Path | Description |
|---|---|---|
GET | /workspaces/{wid}/membros | List members |
POST | /workspaces/{wid}/convites | Invite someone |
GET POST | /workspaces/{wid}/grupos | List / 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.
| Method | Path | Description |
|---|---|---|
GET | /webhooks/eventos | Catalog of available events |
GET POST | /workspaces/{wid}/webhooks | List / create a webhook |
PUT DELETE | /webhooks/{id} | Update / delete |
GET | /webhooks/{id}/entregas | Last deliveries (log) |
POST | /webhooks/{id}/testar | Send 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
| Method | Path | Description |
|---|---|---|
GET | /chaves | List your keys |
POST | /chaves | Create a key (returns the token once) |
PATCH | /chaves/{id}/renomear | Rename |
POST | /chaves/{id}/revogar | Revoke |
DELETE | /chaves/{id} | Delete |
Want an AI agent or IDE to read and edit the wiki? See the MCP server.