# MediaWiki

> Write to a wiki that runs MediaWiki, signed in as your account: create and edit pages, add to a running log, read a page for an AI step, search, file pages in categories, upload files, and move or delete pages. Start a workflow when a page is created or edited, or a file is uploaded.

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

## Actions

### Add or remove categories

Put a page in categories or take it out of them, as one edit to its text. A category a template adds can only be changed in the template.

**Inputs**

- Page (`page`, text, required): The page's title, such as Meeting notes, or its link on the wiki.
- Add (`add`, list): Categories to put the page in.
- Remove (`remove`, list): Categories to take the page out of.
- Edit summary (`summary`, text): A short note for the page's history. Leave blank for one naming the categories.
- Minor edit (`minor`, true/false): Mark the edit as minor, such as for a typo fix. Defaults to off. Default: `false`.

**Outputs**

- `added` (list): The categories added
- `categories` (list): The categories the page is in now
- `changed` (true/false): Whether the page was edited
- `link` (text): Where the page opens on the wiki
- `not_found` (list): Categories to take out that the page's text doesn't name; one a template adds can only be taken out of the template
- `page_id` (number): The page's ID
- `removed` (list): The categories taken out
- `revision_id` (number): The page's latest revision, after the change
- `title` (text): The page's title

**Example output**

```json
{
  "added": [
    "Reviewed"
  ],
  "categories": [
    "Finance",
    "Reviewed"
  ],
  "changed": true,
  "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
  "not_found": [],
  "page_id": 42,
  "removed": [
    "Drafts"
  ],
  "revision_id": 1235,
  "title": "Meeting notes 2026-11-05"
}
```

### Create page

Make a new page on the wiki, such as meeting notes or a report, in wikitext, with categories. Stops if a page with that title exists.

**Inputs**

- Title (`title`, text, required): The new page's title, such as Meeting notes 2026-11-05.
- Content (`content`, text, required): What the page says, in wikitext (MediaWiki's markup, such as == Heading == and [[Another page]]); plain text works too.
- Edit summary (`summary`, text): A short note on what changed, shown in the page's history.
- Categories (`categories`, list): Categories to put the page in, such as Meetings.
- Bot edit (`bot`, true/false): Mark the edit as a bot's, so it's hidden from recent changes by default. Only works when the account is in the wiki's bot group. Defaults to off. Default: `false`.

**Outputs**

- `changed` (true/false): Whether anything changed: false when the page already said that
- `created` (true/false): Whether the edit made the page
- `diff_link` (text): Where the wiki shows what the edit changed
- `edited_at` (text): When it was saved (ISO 8601)
- `link` (text): Where the page opens on the wiki
- `page_id` (number): The page's ID
- `previous_revision_id` (number): The ID of the revision before it; 0 for a new page
- `revision_id` (number): The ID of the revision the edit made
- `title` (text): The page's title, as the wiki writes it

**Example output**

```json
{
  "changed": true,
  "created": true,
  "diff_link": "https://wiki.example.com/w/index.php?diff=1234&oldid=1230",
  "edited_at": "2026-11-05T10:00:00Z",
  "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
  "page_id": 42,
  "previous_revision_id": 0,
  "revision_id": 1234,
  "title": "Meeting notes 2026-11-05"
}
```

### Delete page

Delete a page, or a file with its page. Needs the right to delete, which most wikis give only administrators; an administrator can restore it.

**Inputs**

- Page (`page`, text, required): The page's title, such as Meeting notes, or its link on the wiki.
- Reason (`reason`, text): Why it was deleted, shown in the wiki's deletion log.

**Outputs**

- `deleted` (true/false): Whether the page was deleted
- `log_id` (number): The deletion's entry in the wiki's log
- `reason` (text): The reason recorded in the deletion log
- `title` (text): The page's title

**Example output**

```json
{
  "deleted": true,
  "log_id": 88,
  "reason": "Out of date",
  "title": "Meeting notes 2026-11-05"
}
```

### Edit page

Change a page: replace its text, add to its start or end (such as a running log), or add a new section, with an edit summary.

**Inputs**

- Page (`page`, text, required): The page's title, such as Meeting notes, or its link on the wiki.
- Content (`content`, text, required): The wikitext to put on the page, in the way chosen in Replace or add.
- Replace or add (`mode`, text): Whether the content replaces the page's text, is added to its end or start, or becomes a new section at the end. Defaults to replacing it. One of: `replace` (Replace the page), `append` (Add to the end), `prepend` (Add to the start), `new_section` (Add a new section). Default: `replace`.
- Section heading (`section_title`, text): The new section's heading, when adding a new section.
- Edit summary (`summary`, text): A short note on what changed, shown in the page's history.
- Minor edit (`minor`, true/false): Mark the edit as minor, such as for a typo fix. Defaults to off. Default: `false`.
- Bot edit (`bot`, true/false): Mark the edit as a bot's, so it's hidden from recent changes by default. Only works when the account is in the wiki's bot group. Defaults to off. Default: `false`.
- Create if missing (`create_if_missing`, true/false): Make the page if there's none with that title. Off, the step stops instead, so a mistyped title doesn't make a stray page. Default: `false`.
- Based on revision (`base_revision`, number): The revision ID the new text was worked out from, such as the Revision ID from Get page. If someone else edited the page since, the edit stops instead of overwriting theirs. At least 1.

**Outputs**

- `changed` (true/false): Whether anything changed: false when the page already said that
- `created` (true/false): Whether the edit made the page
- `diff_link` (text): Where the wiki shows what the edit changed
- `edited_at` (text): When it was saved (ISO 8601)
- `link` (text): Where the page opens on the wiki
- `page_id` (number): The page's ID
- `previous_revision_id` (number): The ID of the revision before it; 0 for a new page
- `revision_id` (number): The ID of the revision the edit made
- `title` (text): The page's title, as the wiki writes it

**Example output**

```json
{
  "changed": true,
  "created": false,
  "diff_link": "https://wiki.example.com/w/index.php?diff=1234&oldid=1230",
  "edited_at": "2026-11-05T10:00:00Z",
  "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
  "page_id": 42,
  "previous_revision_id": 1230,
  "revision_id": 1234,
  "title": "Meeting notes 2026-11-05"
}
```

### Get page

Get a page's text, as wikitext, HTML or plain text, with its latest revision, categories and who last edited it, such as for an AI step.

**Inputs**

- Page (`page`, text, required): The page's title, such as Meeting notes, or its link on the wiki.
- Format (`content_format`, text): How to give the page's text: its wikitext, or as the wiki shows it, in HTML or plain text. Defaults to wikitext. One of: `wikitext`, `html`, `plain_text` (Plain text). Default: `wikitext`.
- Follow redirects (`follow_redirects`, true/false): When the page redirects to another, get that one. Defaults to on. Default: `true`.

**Outputs**

- `categories` (list): The categories it's in, without the Category: prefix
- `content` (text): What the page says, in the format asked for
- `format` (text): The content's format: wikitext, html or plain_text
- `last_edited_at` (text): When it was last edited (ISO 8601)
- `last_edited_by` (text): Who last edited it
- `last_summary` (text): The summary of the last edit
- `link` (text): Where the page opens on the wiki
- `namespace` (number): The page's namespace: 0 for articles
- `page_id` (number): The page's ID
- `protection` (list): How it's protected, such as edit: sysop; empty when it isn't
- `redirected_from` (text): The title asked for, when it redirected here; else empty
- `revision_id` (number): The ID of its latest revision
- `size` (number): Its size in bytes
- `title` (text): The page's title

**Example output**

```json
{
  "categories": [
    "Meetings",
    "Finance"
  ],
  "content": "== Decisions ==\n* Close the books on the 30th\n\n[[Category:Meetings]]",
  "format": "wikitext",
  "last_edited_at": "2026-11-05T10:00:00Z",
  "last_edited_by": "Ada",
  "last_summary": "Added the decisions",
  "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
  "namespace": 0,
  "page_id": 42,
  "protection": [],
  "redirected_from": "",
  "revision_id": 1234,
  "size": 512,
  "title": "Meeting notes 2026-11-05"
}
```

### Get page history

List a page's revisions, newest first: who changed it, when, how much and why, with a link to each change.

**Inputs**

- Page (`page`, text, required): The page's title, such as Meeting notes, or its link on the wiki.
- How many (`limit`, number): The most revisions to list. Defaults to 20. From 1 to 50.

**Outputs**

- `count` (number): How many are listed
- `link` (text): Where the page opens
- `page_id` (number): The page's ID
- `revisions` (list): The revisions, newest first
- `title` (text): The page's title

**Example output**

```json
{
  "count": 1,
  "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
  "page_id": 42,
  "revisions": [
    {
      "diff_link": "https://wiki.example.com/w/index.php?diff=1234&oldid=1230",
      "edited_at": "2026-11-05T10:00:00Z",
      "minor": false,
      "previous_revision_id": 1230,
      "revision_id": 1234,
      "size": 512,
      "size_change": 120,
      "summary": "Added the decisions",
      "user": "Ada"
    }
  ],
  "title": "Meeting notes 2026-11-05"
}
```

### List pages in a category

List the pages, subcategories or files in a category, by name or most recently added.

**Inputs**

- Category (`category`, text, required): The category, such as Meetings.
- List (`member_type`, text): Which members to list. Defaults to pages. One of: `page` (Pages), `subcat` (Subcategories), `file` (Files), `all` (Everything). Default: `page`.
- Order (`sort`, text): Which come first. Defaults to by name. One of: `name` (By name), `newest` (Most recently added). Default: `name`.
- How many (`limit`, number): The most members to list. Defaults to 20. From 1 to 50.

**Outputs**

- `category` (text): The category's title
- `count` (number): How many are listed
- `members` (list): The category's members
- `total` (number): How many of that kind the category has in all

**Example output**

```json
{
  "category": "Category:Meetings",
  "count": 1,
  "members": [
    {
      "added_at": "2026-11-05T10:00:00Z",
      "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
      "namespace": 0,
      "page_id": 42,
      "title": "Meeting notes 2026-11-05",
      "type": "page"
    }
  ],
  "total": 1
}
```

### List recent changes

List the wiki's latest edits, new pages or logged actions (uploads, moves, deletions), newest first, such as for a weekly digest.

**Inputs**

- Changes (`change_type`, text): Which changes to list. Defaults to edits and new pages. One of: `edits_and_new` (Edits and new pages), `new` (New pages), `edit` (Edits), `log` (Uploads, moves, deletions and other logged actions). Default: `edits_and_new`.
- Namespace (`namespace`, text): Only changes in this namespace. Leave blank for articles (the main namespace).
- Since (`since`, date and time): Only changes after this time. Leave blank for the latest. Wikis keep about 90 days of changes.
- Hide bot edits (`hide_bots`, true/false): Leave out changes marked as a bot's. Defaults to off. Default: `false`.
- How many (`limit`, number): The most changes to list. Defaults to 20. From 1 to 50.

**Outputs**

- `changes` (list): The changes, newest first
- `count` (number): How many are listed

**Example output**

```json
{
  "changes": [
    {
      "bot": false,
      "diff_link": "https://wiki.example.com/w/index.php?diff=1234&oldid=1230",
      "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
      "log_action": "",
      "log_type": "",
      "minor": false,
      "namespace": 0,
      "page_id": 42,
      "previous_revision_id": 1230,
      "revision_id": 1234,
      "size": 512,
      "size_change": 120,
      "summary": "Added the decisions",
      "timestamp": "2026-11-05T10:00:00Z",
      "title": "Meeting notes 2026-11-05",
      "type": "edit",
      "user": "Ada"
    }
  ],
  "count": 1
}
```

### Move page

Rename a page, with its talk page. The old title redirects to the new one unless you turn that off. Needs the right to move pages.

**Inputs**

- Page (`page`, text, required): The page's title, such as Meeting notes, or its link on the wiki.
- New title (`new_title`, text, required): The page's new title, such as Archive/Meeting notes.
- Reason (`reason`, text): Why it moved, shown in the wiki's move log.
- Leave a redirect (`leave_redirect`, true/false): Keep the old title working, sending readers to the new one. Turning it off needs the right to move without one. Defaults to on. Default: `true`.
- Move talk page (`move_talk_page`, true/false): Move the page's talk page with it. Defaults to on. Default: `true`.
- Move subpages (`move_subpages`, true/false): Move its subpages (Title/...) too, where the wiki has them. Defaults to off. Default: `false`.

**Outputs**

- `link` (text): Where it opens now
- `new_title` (text): The title it has now
- `old_title` (text): The title it had
- `redirect_left` (true/false): Whether the old title now redirects to it
- `subpages_moved` (number): How many subpages moved with it
- `talk_page_moved_to` (text): Where its talk page went; empty when it has none

**Example output**

```json
{
  "link": "https://wiki.example.com/wiki/Archive/Meeting_notes_2026-11-05",
  "new_title": "Archive/Meeting notes 2026-11-05",
  "old_title": "Meeting notes 2026-11-05",
  "redirect_left": true,
  "subpages_moved": 0,
  "talk_page_moved_to": ""
}
```

### Search pages

Find pages with the wiki's own search, best match first, with the words around each match.

**Inputs**

- Search for (`query`, text, required): Words to find, such as budget 2026.
- Search in (`search_in`, text): Whether to look in the pages' text or only their titles. Defaults to the text. One of: `text` (Page text), `title` (Titles). Default: `text`.
- Namespace (`namespace`, text): Where to look. Leave blank for articles (the main namespace).
- How many (`limit`, number): The most pages to list. Defaults to 20. From 1 to 50.

**Outputs**

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

**Example output**

```json
{
  "count": 1,
  "results": [
    {
      "last_edited_at": "2026-11-05T10:00:00Z",
      "link": "https://wiki.example.com/wiki/Meeting_notes_2026-11-05",
      "page_id": 42,
      "size": 512,
      "snippet": "Close the books on the 30th",
      "title": "Meeting notes 2026-11-05",
      "words": 80
    }
  ],
  "total": 1
}
```

### Upload file

Put a file on the wiki, such as a picture or a PDF, from an upload, an earlier step or a link, or a new version of one that's there.

**Inputs**

- File (`file`, text, required): The file: upload it, pick one from an earlier step, or paste a link. The wiki takes only the types its administrator allowed, often pictures and PDFs.
- File name (`filename`, text): Its name on the wiki, with its ending, such as Report 2026.pdf. Leave blank to keep the file's own name.
- Description (`page_text`, text): The wikitext of the file's page, such as what it shows and its licence. Used only for a new file.
- Upload summary (`comment`, text): A short note shown in the file's history.
- Replace existing file (`replace_existing`, true/false): When a file has that name already, upload this as its new version. Off, the step stops instead. Defaults to off. Default: `false`.

**Outputs**

- `changed` (true/false): Whether anything changed: false when the wiki had this file already
- `duplicates` (list): Other files on the wiki (or deleted from it) with the same content
- `file_name` (text): The file's name on the wiki, such as Report.pdf
- `file_url` (text): Where the file itself downloads from
- `link` (text): Where its page opens on the wiki
- `mime_type` (text): Its type, such as image/png
- `replaced` (true/false): Whether it replaced a file of the same name
- `size` (number): Its size in bytes
- `title` (text): Its page's title, such as File:Report.pdf
- `uploaded_at` (text): When this version was uploaded (ISO 8601)
- `uploaded_by` (text): Who uploaded it

**Example output**

```json
{
  "changed": true,
  "duplicates": [],
  "file_name": "Report.pdf",
  "file_url": "https://wiki.example.com/images/a/ab/Report.pdf",
  "link": "https://wiki.example.com/wiki/File:Report.pdf",
  "mime_type": "application/pdf",
  "replaced": false,
  "size": 20480,
  "title": "File:Report.pdf",
  "uploaded_at": "2026-11-05T10:00:00Z",
  "uploaded_by": "Ada"
}
```
