# BookStack

> Keep your BookStack wiki up to date: publish and update pages from workflows, read a page for an AI step or an email, search the wiki, and add books, chapters and attachments. Start a workflow when a page is added or changed.

App · 11 actions. Web page: https://docs.lodol.com/docs/integrations/bookstack

## Actions

### Add attachment

Attach a file, or a link, to a page. It shows in the page's attachments.

**Inputs**

- Page (`page`, text, required): The page's ID (a number, such as 42) from another BookStack step or the trigger, or its link in BookStack.
- File (`file`, text): The file: upload one, pick one from an earlier step, or give a public https link to download. Leave blank to attach a link.
- Link (`link`, text): A web address to attach as a link instead of a file, such as a shared folder.
- Name (`name`, text): What the attachment is called. Defaults to the file's name or the link.

**Outputs**

- `created_at` (text): When it was added (ISO 8601)
- `extension` (text): The file's extension, such as pdf; empty for a link
- `id` (number): The attachment's ID
- `kind` (text): file, or link for a link
- `link` (text): Where it opens in BookStack
- `name` (text): The attachment's name
- `page_id` (number): The ID of the page it's on

**Example output**

```json
{
  "created_at": "2026-11-05T10:05:00.000000Z",
  "extension": "xlsx",
  "id": 5,
  "kind": "file",
  "link": "https://wiki.example.com/attachments/5",
  "name": "Budget.xlsx",
  "page_id": 42
}
```

### Create book

Add a book, such as for a new project or client, and put it on a shelf.

**Inputs**

- Name (`name`, text, required): What the book is called.
- Description (`description`, text): What it's about, shown under its name.
- Tags (`tags`, object): Tags, by name, such as {"Client": "Acme"}.
- Shelf (`shelf`, text): A shelf to put it on. Leave blank for none.

**Outputs**

- `created_at` (text): When it was added (ISO 8601)
- `description` (text): What it's about
- `id` (number): The book's ID
- `link` (text): Its link in BookStack
- `name` (text): The book's name
- `shelf_id` (number): The ID of the shelf it was put on; 0 if none
- `tags` (object): Its tags, by name, such as {"Status": "Draft"}
- `updated_at` (text): When it last changed (ISO 8601)

**Example output**

```json
{
  "created_at": "2026-10-01T09:00:00.000000Z",
  "description": "Notes from every team meeting",
  "id": 7,
  "link": "https://wiki.example.com/books/meeting-notes",
  "name": "Meeting notes",
  "shelf_id": 3,
  "tags": {},
  "updated_at": "2026-11-05T10:00:00.000000Z"
}
```

### Create chapter

Add a chapter to a book, to group its pages.

**Inputs**

- Book (`book`, text, required): The book to add it to.
- Name (`name`, text, required): What the chapter is called.
- Description (`description`, text): What it's about, shown under its name.
- Tags (`tags`, object): Tags, by name, such as {"Year": "2026"}.

**Outputs**

- `book_id` (number): The ID of the book it's in
- `book_name` (text): The name of the book it's in
- `created_at` (text): When it was added (ISO 8601)
- `description` (text): What it's about
- `id` (number): The chapter's ID
- `link` (text): Its link in BookStack
- `name` (text): The chapter's name
- `tags` (object): Its tags, by name, such as {"Status": "Draft"}
- `updated_at` (text): When it last changed (ISO 8601)

**Example output**

```json
{
  "book_id": 7,
  "book_name": "Meeting notes",
  "created_at": "2026-01-02T09:00:00.000000Z",
  "description": "This year's meetings",
  "id": 12,
  "link": "https://wiki.example.com/books/meeting-notes/chapter/2026",
  "name": "2026",
  "tags": {},
  "updated_at": "2026-01-02T09:00:00.000000Z"
}
```

### Create page

Publish a page in a book, or in one of its chapters, such as meeting notes or a report, written in Markdown, HTML or plain text.

**Inputs**

- Book (`book`, text, required): The book to put the page in.
- Chapter (`chapter`, text): The chapter to put it in, in that book. Leave blank to put it in the book itself.
- Title (`name`, text, required): The page's title.
- Content (`content`, text, required): What the page says, in the format chosen.
- Format (`content_format`, text): How the content is written. Defaults to Markdown. One of: `markdown`, `html`, `plain_text` (Plain text). Default: `markdown`.
- Tags (`tags`, object): Tags to add, by name, such as {"Status": "Draft"}.

**Outputs**

- `book_id` (number): The ID of the book it's in
- `book_name` (text): The name of the book it's in
- `chapter_id` (number): The ID of the chapter it's in; 0 if it isn't in one
- `created_at` (text): When it was added (ISO 8601)
- `created_by` (text): Who added it; empty in a list
- `editor` (text): The editor it was written in: wysiwyg or markdown
- `id` (number): The page's ID
- `link` (text): Its permanent link in BookStack, which works after a rename
- `name` (text): The page's title
- `revision_count` (number): How many times it has been saved
- `tags` (object): Its tags, by name, such as {"Status": "Draft"}
- `updated_at` (text): When it last changed (ISO 8601)
- `updated_by` (text): Who last changed it; empty in a list

**Example output**

```json
{
  "book_id": 7,
  "book_name": "Meeting notes",
  "chapter_id": 12,
  "created_at": "2026-11-05T10:00:00.000000Z",
  "created_by": "Ada Lovelace",
  "editor": "markdown",
  "id": 42,
  "link": "https://wiki.example.com/link/42",
  "name": "Team meeting, 5 November",
  "revision_count": 1,
  "tags": {
    "Team": "Finance"
  },
  "updated_at": "2026-11-05T10:00:00.000000Z",
  "updated_by": "Ada Lovelace"
}
```

### Delete page, chapter or book

Move a page, chapter or book to BookStack's recycle bin, where an admin can restore it. A chapter or book takes its pages with it.

**Inputs**

- Type (`item_type`, text, required): What it is. One of: `page`, `chapter`, `book`.
- Page, chapter or book (`item`, text, required): Its ID from another BookStack step or the trigger, or its link in BookStack.

**Outputs**

- `deleted` (true/false): Whether it was moved to the recycle bin
- `id` (number): Its ID
- `item_type` (text): What it was: page, chapter or book
- `name` (text): Its name or title

**Example output**

```json
{
  "deleted": true,
  "id": 42,
  "item_type": "page",
  "name": "Team meeting, 5 November"
}
```

### Get page

Get a page's details and what it says, as Markdown, plain text or HTML, such as for an AI step or an email.

**Inputs**

- Page (`page`, text, required): The page's ID (a number, such as 42) from another BookStack step or the trigger, or its link in BookStack.
- Format (`content_format`, text): How to give the content. Defaults to Markdown. One of: `markdown`, `html`, `plain_text` (Plain text). Default: `markdown`.

**Outputs**

- `book_id` (number): The ID of the book it's in
- `book_name` (text): The name of the book it's in
- `chapter_id` (number): The ID of the chapter it's in; 0 if it isn't in one
- `content` (text): What the page says, in the format asked for
- `created_at` (text): When it was added (ISO 8601)
- `created_by` (text): Who added it; empty in a list
- `editor` (text): The editor it was written in: wysiwyg or markdown
- `format` (text): The content's format: markdown, plain_text or html
- `id` (number): The page's ID
- `link` (text): Its permanent link in BookStack, which works after a rename
- `name` (text): The page's title
- `revision_count` (number): How many times it has been saved
- `tags` (object): Its tags, by name, such as {"Status": "Draft"}
- `updated_at` (text): When it last changed (ISO 8601)
- `updated_by` (text): Who last changed it; empty in a list

**Example output**

```json
{
  "book_id": 7,
  "book_name": "Meeting notes",
  "chapter_id": 12,
  "content": "## Decisions\n\n- Close the books on the 30th",
  "created_at": "2026-11-05T10:00:00.000000Z",
  "created_by": "Ada Lovelace",
  "editor": "markdown",
  "format": "markdown",
  "id": 42,
  "link": "https://wiki.example.com/link/42",
  "name": "Team meeting, 5 November",
  "revision_count": 1,
  "tags": {
    "Team": "Finance"
  },
  "updated_at": "2026-11-05T10:00:00.000000Z",
  "updated_by": "Ada Lovelace"
}
```

### List books

List the books, by name, or the books on a shelf.

**Inputs**

- Shelf (`shelf`, text): Only the books on this shelf.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `books` (list): The books
- `count` (number): How many are listed
- `total` (number): How many there are in all

**Example output**

```json
{
  "books": [
    {
      "created_at": "2026-10-01T09:00:00.000000Z",
      "description": "Notes from every team meeting",
      "id": 7,
      "link": "https://wiki.example.com/books/meeting-notes",
      "name": "Meeting notes",
      "tags": {},
      "updated_at": "2026-11-05T10:00:00.000000Z"
    }
  ],
  "count": 1,
  "total": 1
}
```

### List pages

List the pages in a book or a chapter, or in every book, most recently updated first.

**Inputs**

- Book (`book`, text): The book to list. Leave blank for every book.
- Chapter (`chapter`, text): Only the pages in this chapter of the book.
- Order (`sort`, text): Which come first. Defaults to recently updated. One of: `updated` (Recently updated), `created` (Recently added), `name`. Default: `updated`.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `pages` (list): The pages
- `total` (number): How many there are in all

**Example output**

```json
{
  "count": 1,
  "pages": [
    {
      "book_id": 7,
      "book_name": "Meeting notes",
      "chapter_id": 12,
      "created_at": "2026-11-05T10:00:00.000000Z",
      "created_by": "Ada Lovelace",
      "editor": "markdown",
      "id": 42,
      "link": "https://wiki.example.com/link/42",
      "name": "Team meeting, 5 November",
      "revision_count": 1,
      "tags": {
        "Team": "Finance"
      },
      "updated_at": "2026-11-05T10:00:00.000000Z",
      "updated_by": "Ada Lovelace"
    }
  ],
  "total": 1
}
```

### List shelves

List the shelves, which group books, by name.

**Inputs**

- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `shelves` (list): The shelves
- `total` (number): How many there are in all

**Example output**

```json
{
  "count": 1,
  "shelves": [
    {
      "created_at": "2026-01-02T09:00:00.000000Z",
      "description": "A book for each team",
      "id": 3,
      "link": "https://wiki.example.com/shelves/teams",
      "name": "Teams",
      "updated_at": "2026-01-02T09:00:00.000000Z"
    }
  ],
  "total": 1
}
```

### Search

Find pages, chapters, books and shelves the way BookStack's search box does, best match first.

**Inputs**

- Search for (`query`, text, required): Words to find, as typed in BookStack's search box. Put a phrase in quotes to find it exactly ("leave policy"), a tag in square brackets to find what carries it ([Status=Draft]), and a minus before a word to leave out what has it (-draft).
- Look for (`types`, list): What to find. Leave blank for everything. One or more of: `page` (Pages), `chapter` (Chapters), `book` (Books), `bookshelf` (Shelves).
- Book (`book`, text): Only search inside this book. Leave blank to search everything.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `results` (list): What was found, best match first
- `total` (number): How many there are in all

**Example output**

```json
{
  "count": 1,
  "results": [
    {
      "book_id": 7,
      "book_name": "Meeting notes",
      "chapter_id": 12,
      "chapter_name": "2026",
      "id": 42,
      "link": "https://wiki.example.com/link/42",
      "name": "Team meeting, 5 November",
      "preview": "Close the books on the 30th",
      "tags": {
        "Team": "Finance"
      },
      "type": "page",
      "updated_at": "2026-11-05T10:00:00.000000Z"
    }
  ],
  "total": 1
}
```

### Update page

Change a page's content, by replacing it or adding to the end, its title or tags, or move it to another book or chapter. Fields left blank keep what the page has.

**Inputs**

- Page (`page`, text, required): The page's ID (a number, such as 42) from another BookStack step or the trigger, or its link in BookStack.
- Title (`name`, text): A new title. Leave blank to keep it.
- Content (`content`, text): The new content, in the format chosen. Leave blank to keep it.
- Format (`content_format`, text): How the content is written. Defaults to Markdown. One of: `markdown`, `html`, `plain_text` (Plain text). Default: `markdown`.
- Replace or add (`mode`, text): Whether the content replaces what the page says, or is added to the end of it, such as for a running log. One of: `replace` (Replace the content), `append` (Add to the end). Default: `replace`.
- Tags (`tags`, object): Tags, by name, such as {"Status": "Approved"}. They replace the page's tags. Leave blank to keep them.
- Book (`book`, text): A book to move the page to. Leave blank to keep it where it is.
- Chapter (`chapter`, text): A chapter to move the page to.
- Changelog (`changelog`, text): A short note on what changed, shown in the page's revisions, at most 180 characters.

**Outputs**

- `book_id` (number): The ID of the book it's in
- `book_name` (text): The name of the book it's in
- `chapter_id` (number): The ID of the chapter it's in; 0 if it isn't in one
- `created_at` (text): When it was added (ISO 8601)
- `created_by` (text): Who added it; empty in a list
- `editor` (text): The editor it was written in: wysiwyg or markdown
- `id` (number): The page's ID
- `link` (text): Its permanent link in BookStack, which works after a rename
- `name` (text): The page's title
- `revision_count` (number): How many times it has been saved
- `tags` (object): Its tags, by name, such as {"Status": "Draft"}
- `updated_at` (text): When it last changed (ISO 8601)
- `updated_by` (text): Who last changed it; empty in a list

**Example output**

```json
{
  "book_id": 7,
  "book_name": "Meeting notes",
  "chapter_id": 12,
  "created_at": "2026-11-05T10:00:00.000000Z",
  "created_by": "Ada Lovelace",
  "editor": "markdown",
  "id": 42,
  "link": "https://wiki.example.com/link/42",
  "name": "Team meeting, 5 November",
  "revision_count": 1,
  "tags": {
    "Team": "Finance"
  },
  "updated_at": "2026-11-05T10:00:00.000000Z",
  "updated_by": "Ada Lovelace"
}
```
