How to import a folder of Markdown files into Confluence Cloud, keeping the page tree and links

Updated 2 December 2026 · 9 min read

Short answer: Confluence Cloud cannot import a folder of Markdown files natively. Its editor converts Markdown one page at a time, and Atlassian's import tools cover Word, Google Docs, OneDrive, Notion and HTML but not Markdown. To import a whole folder as a page tree you need a script against the REST API, an open-source publisher such as mark or md2conf, or a Marketplace app. Whichever you pick, make sure it rebuilds the folder hierarchy, rewrites relative links and can run again without creating duplicate pages.

What does importing a Markdown folder into Confluence involve?

A Markdown folder import turns a directory of .md files into Confluence pages and keeps the directory structure as a page tree. A useful import does five things:

  • Hierarchy: folders become parent pages and files become child pages.
  • Titles: every file gets a title that is unique within its Confluence space.
  • Links: relative links such as ../runbooks/rollback.md become links to the matching Confluence pages.
  • Content: headings, tables, code blocks and lists arrive as native Confluence content, not a block of raw text.
  • Re-runs: importing the same folder again updates pages instead of creating copies.

Here is an example source folder and the page tree you would want from it (illustrative):

handbook/
  README.md
  onboarding/
    README.md
    laptop-setup.md
  runbooks/
    README.md
    deploy.md
    rollback.md
Handbook              (from handbook/README.md)
  Onboarding          (from onboarding/README.md)
    Laptop setup
  Runbooks            (from runbooks/README.md)
    Deploy
    Rollback

Three files named README.md cannot all keep that name, because Confluence requires unique page titles within a space. How a tool handles that collision is one of the first things to test. See duplicate page titles when importing Markdown into Confluence.

Can Confluence Cloud import Markdown files natively?

No. Three built-in features come close, and none of them handles a folder.

  • Typing and pasting: the editor converts Markdown shortcuts as you type, and Atlassian added a paste options toolbar for Markdown pasted from outside Confluence. This works on one page at a time and does not connect links between files. See pasting Markdown into Confluence.
  • Import external documents: Atlassian's import page covers Word (.docx), Google Docs and OneDrive files, and its other import pages cover Notion, HTML and whiteboard tools. Markdown is not listed. Converting files to .docx first works for a handful of documents (bulk import is capped at 30 files and 50 MB), but nothing rebuilds your folder tree or rewrites links.
  • Export: Atlassian has been rolling out an Export to Markdown option for single pages since mid 2026, and availability varies by site as of December 2026. It moves content out of Confluence, not in.

Atlassian's public suggestion for bulk Markdown import, CONFSERVER-59543, is filed against Confluence Data Center and is still in Gathering Interest status.

Which method should you use to import a Markdown folder?

MethodKeeps folder treeRewrites links between filesRe-runs without duplicatesFits when
Paste page by pageNoNoNoFewer than five pages with no cross-links
Convert to .docx, then Word importNoNoNoA one-off move of a few documents
Your own REST API scriptIf you build itIf you build itIf you build itYou need custom conversion and have developer time
Open-source CLI (mark, md2conf)Yes, documentedYes, documentedYes, by title or page IDDevelopers who run it from a terminal or CI
Marketplace appVariesVariesVariesAdmins who want a UI (see the selection checklist)
Folio for ConfluenceYesYesYesTeams that want a preview and no scripting, on Confluence Cloud

If you are moving a folder once and never touching it again, any of the first four rows is enough. If the folder will be edited and imported repeatedly, only a method that remembers which file belongs to which page will stay clean.

How do you import Markdown with a script against the Confluence REST API?

The Confluence Cloud REST API v2 has no Markdown body format. The page endpoints accept the representations storage (Confluence's XHTML-based storage format), atlas_doc_format (Atlassian Document Format JSON) and wiki, so a script has to convert Markdown first. The page endpoints are documented by Atlassian. The outline:

  1. Look up the space ID. The v2 API takes a numeric spaceId, not the space key. GET /wiki/api/v2/spaces?keys=ENG returns it.
  2. Walk the folder. Build a tree with one node per .md file and use each folder's README.md or index.md as its parent.
  3. Convert each file. Map headings, tables, lists and callouts to storage format or ADF. In storage format a fenced code block becomes an ac:structured-macro element named code.
  4. Create pages parent first. Call POST /wiki/api/v2/pages with a parentId. If you leave it out, Confluence uses the space homepage. Record each returned page ID against the file path.
  5. Rewrite links in a second pass. A link to ../runbooks/rollback.md can only become a Confluence link after the target page exists. Update each page with PUT /wiki/api/v2/pages/{id}, which needs the full body and a version.number one higher than the current version.
  6. Back off on rate limits. Confluence answers with HTTP 429 and a Retry-After header when you exceed its rate limits. A create request larger than 5 MB returns 413.
  7. Save the map. Store path to page ID so the next run updates pages instead of creating new ones.

A create call looks like this (example values):

curl --request POST \
  --url "https://your-domain.atlassian.net/wiki/api/v2/pages" \
  --user "[email protected]:$ATLASSIAN_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "spaceId": "1234567",
    "status": "current",
    "title": "Deploy",
    "parentId": "7654321",
    "body": {
      "representation": "storage",
      "value": "<h2>Before you deploy</h2><p>Check the release checklist.</p>"
    }
  }'

Scoped API tokens are sent through the api.atlassian.com gateway instead of your site URL, as the mark and md2conf READMEs describe. Most of a script's effort goes into conversion fidelity, not the API calls.

Which open-source tools publish a Markdown folder to Confluence?

Two command line tools publish Markdown to Confluence Cloud. Read each README and license for current behavior before you rely on them.

  • mark is a Go tool under the Apache-2.0 license. Each file names its page in header comments (Space, Parent, Title). Its README says it creates a page if none is found by that name, offers --track-pages so a renamed file updates the same page, and --parents-from-path to nest pages by directory. --dry-run shows the resolved pages and HTML without writing. For Confluence Cloud, add /wiki to the base URL.
  • md2conf is a Python package (pip install markdown-to-confluence) under the MIT license. In directory mode it walks the folder recursively, treats index.md or README.md as the parent page of its directory, replaces relative links with Confluence URLs and uploads local images as attachments. Folders are flattened unless you pass --keep-hierarchy. It links files to pages by a page ID in a comment or front matter, or by title, and by default writes new page IDs back into your source files.

Both need an API token and somewhere to run, usually CI. The Git sync guide covers running them on every merge.

What about Marketplace apps that import Markdown?

Several Marketplace apps import Markdown into Confluence Cloud. They differ in whether they take one file or a whole folder, whether they preview the page tree, how they remember pages for re-imports, and where your content is processed. The importer selection checklist gives neutral criteria and a short test you can run on any of them.

How do you import a Markdown folder with Folio for Confluence?

Folio for Confluence is an Atlassian Forge app for Confluence Cloud. Its Import tab parses your files in the browser and writes native Confluence pages as you. Steps:

  1. Install Folio on your Confluence Cloud site. A site admin approves the install.
  2. Open the app. In any space, select Space apps → Folio for Confluence in the sidebar and stay on the Import tab.
  3. Add your files. Drop a local folder or a .zip of Markdown. Dotfiles, .git/ and __MACOSX/ are skipped. To try it first, load the 8-page sample handbook.
  4. Review the page tree. A folder's README.md or index.md becomes the parent page, and folders without one get an automatic index page. Duplicate titles, such as several README.md files, are disambiguated by folder so Confluence's unique-title rule never fails the import.
  5. Choose a parent page and import. Pass one creates or matches every page and records its page ID. Pass two rewrites relative .md links, including ../ paths and #anchor fragments, to live Confluence URLs.
  6. Check the result. Open the parent page, follow a few cross-document links and look at the labels. YAML frontmatter fields such as owner and status become labels like owner-sre-team and status-draft.
  7. Edit and import again. Re-importing the same files updates pages in place, because a per-space sync map in Forge storage ties file paths to page IDs. An option can adopt existing untracked pages that have matching titles.

Folio converts to Atlassian Document Format: headings, inline marks, GitHub-style tables, fenced code blocks with language, nested lists, task lists, GitHub alerts ([!NOTE] and similar) as Confluence panels, and <details> blocks as expand macros. Raw HTML and README badges are sanitized. It uses the Confluence REST API v2 as the signed-in user, with batching and backoff for rate limits.

Limits to know before you choose it: Folio supports Confluence Cloud only, and Markdown images become [Image: alt] placeholders. It does not sync on a schedule and does not push changes from Confluence back to Git.

What should you check after importing?

  1. Compare the page tree with your folder, especially folders that had no README.md.
  2. Click through a sample of links, including ../ paths and anchors to headings.
  3. Look for leftover .md paths and localhost links. Folio's Audit & fix tab flags both and proposes removing dead links while keeping the link text.
  4. Replace image placeholders by attaching the files.
  5. Decide where edits happen. If the files in Git stay the source, the next import overwrites changes made in Confluence.

Folio's documentation describes each step and its permissions in detail.

FAQ

Does a Markdown folder import bring images across?

Not in every method. Folio for Confluence does not convert images yet: it makes no external requests, so Markdown images become [Image: alt] placeholders that you replace by attaching the files. A script can upload local images as page attachments through the REST API, and md2conf documents that it uploads local images as attachments.

Does a Markdown folder import work on Confluence Data Center?

Folio for Confluence is Confluence Cloud only. Data Center is a separate product with its own APIs, so check each tool's README. The md2conf README, for example, documents an older REST API option for Data Center and Server and says it is not actively supported.

Which user shows as the author of imported pages?

With Folio for Confluence it is the person who runs the import, because Folio calls the Confluence REST API as that user and the changes are recorded in page history. A script or CLI uses the account that owns its API token, so use a dedicated service account if you want a stable, non-personal author.

How long does an Atlassian API token last?

By default one year. When you create a token you can choose an expiry from 1 to 365 days, and Atlassian recommends tokens with scopes. Note the expiry date before a CI job depends on the token.