Skip to content
Developers
GuidesAPI reference
slimwiki.comGet an API key

Guides

  • Quickstart
  • Authentication
  • Errors
  • Pagination
  • Rate limits
  • Content format
  • Versioning

Tools and agents

  • CLI
  • MCP server
  • Agent skill

API reference

  • Overview

Users

  • Retrieve the key ownerget

Accounts

  • List accountsget

Wikis

  • List wikisget
  • Retrieve a wikiget

Pages

  • List pages in a wikiget
  • Search pages in a wikiget
  • Find a page by slug or hashget
  • Create a pagepost
  • Retrieve a pageget
  • Delete a pagedelete
  • Archive a pagepost
  • Restore a pagepost

Guides

Content format

The body of a page is JSON: an array of content nodes. You send this format when you create a page and get it back when you retrieve one.

On this page

  • Nodes
  • Blocks
  • Marks
  • A full example
  • Reading and updating content

Nodes

One block or inline node of page content, for example a paragraph, heading or text run. A page's content is the list of its top-level nodes, in order. A node has these fields:

Fields of a content node
FieldDescription
type
stringrequired

The node type, such as paragraph, heading, bulletList or text.

attrs
objectoptional

Type-specific attributes, such as a heading level.

content
ContentNode[]optional

Child nodes.

text
stringoptional

The text of a text node.

marks
object[]optional

Inline formatting on a text node, such as bold or link.

Blocks such as paragraphs, headings and lists hold other nodes in content. The text itself sits in nodes of type text, which have a text string instead of children.

Blocks

Paragraph

A paragraph contains text nodes.

paragraph
{
  "type": "paragraph",
  "content": [
    {
      "type": "text",
      "text": "Steps we follow for every release."
    }
  ]
}

Heading

A heading contains text nodes and sets its level in attrs.level.

heading
{
  "type": "heading",
  "attrs": {
    "level": 2
  },
  "content": [
    {
      "type": "text",
      "text": "Before the release"
    }
  ]
}

Bulleted list

A bulletList contains listItem nodes. Each list item contains blocks, usually one paragraph.

bulletList
{
  "type": "bulletList",
  "content": [
    {
      "type": "listItem",
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Update the changelog"
            }
          ]
        }
      ]
    },
    {
      "type": "listItem",
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Tag the release"
            }
          ]
        }
      ]
    }
  ]
}

Marks

Inline formatting is a list of marks on a text node. To format part of a sentence, split it into several text nodes and put the marks on the ones they apply to.

Bold

text with a bold mark
{
  "type": "text",
  "text": "every",
  "marks": [
    {
      "type": "bold"
    }
  ]
}

Link

A link mark carries its address in attrs.href.

text with a link mark
{
  "type": "text",
  "text": "release notes",
  "marks": [
    {
      "type": "link",
      "attrs": {
        "href": "https://example.com/release-notes"
      }
    }
  ]
}

A full example

This request to post/v1/pages creates a page with a paragraph that has bold text and a link, a heading and a bulleted list.

Request
curl -X POST "https://api.slimwiki.com/v1/pages" \
  -H "Authorization: Bearer $SLIMWIKI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "wiki_id": "6f1c2d0e-8a3b-4c5d-9e7f-0a1b2c3d4e5f",
  "title": "Release checklist",
  "content": [
    {
      "type": "paragraph",
      "content": [
        {
          "type": "text",
          "text": "Steps we follow for "
        },
        {
          "type": "text",
          "text": "every",
          "marks": [
            {
              "type": "bold"
            }
          ]
        },
        {
          "type": "text",
          "text": " release. See the "
        },
        {
          "type": "text",
          "text": "release notes",
          "marks": [
            {
              "type": "link",
              "attrs": {
                "href": "https://example.com/release-notes"
              }
            }
          ]
        },
        {
          "type": "text",
          "text": "."
        }
      ]
    },
    {
      "type": "heading",
      "attrs": {
        "level": 2
      },
      "content": [
        {
          "type": "text",
          "text": "Before the release"
        }
      ]
    },
    {
      "type": "bulletList",
      "content": [
        {
          "type": "listItem",
          "content": [
            {
              "type": "paragraph",
              "content": [
                {
                  "type": "text",
                  "text": "Update the changelog"
                }
              ]
            }
          ]
        },
        {
          "type": "listItem",
          "content": [
            {
              "type": "paragraph",
              "content": [
                {
                  "type": "text",
                  "text": "Tag the release"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}'

Reading and updating content

get/v1/pages/{page_id} returns a page with its content. The endpoints that list or search pages do not include content; retrieve a page to get it.

Content you read back can contain node types and marks that this guide does not cover. Skip the ones your code does not handle.

Content cannot be updated in v1

You can set a page's content when you create it, and read it back. Updating the content or the title of an existing page is not available in v1.

Previous

Rate limits
How many requests a key can make, the rate limit headers and what to do on a 429.

Next

Versioning
How the API is versioned and which changes can happen within v1.

SlimWiki Developers

slimwiki.com