Wiki API
Read and write the Wiki programmatically, pages, sections, tags, links, revisions and search. This is also where runbooks now live (as Wiki pages).
Base path: /api/v1/wiki · Permission resource: wiki (actions read, write, admin). Pages are addressed by type and key (the entity reference type:key). All requests require authentication.
Pages
| Method | Path | Purpose | Permission |
|---|---|---|---|
| GET | /wiki/pages | List/search pages (types, tags, q, updated_since, limit, offset) | wiki:read |
| GET | /wiki/pages/by-id/{id} | Get a page by id | wiki:read |
| GET | /wiki/pages/{type}/{key} | Get a page by entity ref | wiki:read |
| DELETE | /wiki/pages/{type}/{key} | Delete a page | wiki:admin |
| POST | /wiki/pages/{type}/{key}/undelete | Restore a page | wiki:admin |
| GET | /wiki/pages/{type}/{key}/sections | List sections | wiki:read |
| PUT | /wiki/pages/{type}/{key}/sections/{name} | Create or edit a section | wiki:write |
| DELETE | /wiki/pages/{type}/{key}/sections/{name} | Delete a section | wiki:admin |
| GET | /wiki/pages/{type}/{key}/history | Revision history | wiki:read |
| GET | /wiki/pages/{type}/{key}/backlinks | Pages linking here | wiki:read |
| GET/POST | /wiki/pages/{type}/{key}/tags | List / add tags | wiki:read / wiki:write |
| DELETE | /wiki/pages/{type}/{key}/tags/{tag} | Remove a tag | wiki:write |
Writing knowledge (sections)
The main way to add knowledge is to write a section on a page. PUT /wiki/pages/{type}/{key}/sections/{name} creates the page if it doesn't exist, then sets that section's content. Body:
| Field | Type | Notes |
|---|---|---|
body | string | Markdown, 0-65536 chars. Reference entities with [[type:key]] |
summary | string | optional commit message (why this change) |
tags | string[] | optional tags |
parent_revision_id | uuid | optional, for optimistic concurrency |
curl -s -X PUT "http://localhost:8000/api/v1/wiki/pages/ip/1.2.3.4/sections/Summary" \
-H "Authorization: Bearer $CLOUDPEEK_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "body": "Known benign scanner. Seen in [[incident:204]].", "summary": "Document this IP" }'
For analytic_rule pages, the section body must be valid Sigma YAML (containing title, logsource and detection), or the request is rejected with 422.
Revisions, links and search
| Method | Path | Purpose |
|---|---|---|
| GET | /wiki/revisions/{id} | A specific revision |
| GET | /wiki/revisions/{id}/diff | Diff against the previous revision |
| POST | /wiki/revisions/{id}/revert | Revert to a revision (wiki:write) |
| POST / DELETE | /wiki/links , /wiki/links/{id} | Manage entity links (wiki:write) |
| GET | /wiki/search?q= | Full-text search |
| GET | /wiki/recent | Recent revisions feed |
| GET | /wiki/graph | The entity graph |
| GET | /wiki/tags | Tag cloud |
| GET | /wiki/entities/resolve | Resolve entity references |
| GET | /wiki/events/subscribe | Live updates (Server-Sent Events) |
Entity types
| Method | Path | Purpose |
|---|---|---|
| GET / POST | /wiki/entity-types | List / create entity types (wiki:read / wiki:admin) |
| PATCH / DELETE | /wiki/entity-types/{name} | Update / delete a type (wiki:admin) |
Asking questions about a page
There is no "ask" endpoint under /wiki. To ask CloudPeek a question about a Wiki entity, call the AI Responses API with wiki_entity: "<type>:<key>". That's what the "Ask CloudPeek" panel does.
Related
- The Wiki: the UI and concepts.
- Runbooks API: runbooks are Wiki pages (
entity_type=runbook).