# Confluence

> Confluence Cloud pages and search.

Lets an agent read, create, and edit pages in Confluence Cloud.

## What it can do

| Method | What it does |
| --- | --- |
| `confluence_search` | Search Confluence using CQL and return page/blog content matches. |
| `confluence_list_spaces` | List Confluence spaces available to the current user. |
| `confluence_get_page` | Get one Confluence page by id. |
| `confluence_get_page_by_title` | Find a page by title within a space. Returns selected page and all candidate matches. |
| `confluence_create_page` | Create a Confluence page in a space. |
| `confluence_update_page` | Update existing Confluence page content (auto-increments page version). |
| `confluence_append_to_page` | Append storage-format content to the end of an existing Confluence page. Fetches current storage body, concatenates, and updates page version. |
| `confluence_delete_page` | Delete a Confluence page; pass purge=true to remove permanently. |

## How to get credentials

Confluence Cloud uses an Atlassian API token - the same kind as Jira.

1. Go to
   [id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens).
2. **Create API token**, copy the value.

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `CONFLUENCE_DOMAIN` | `yourcompany.atlassian.net` (no `https://`) |
| `CONFLUENCE_EMAIL` | Your Atlassian account email |
| `CONFLUENCE_API_TOKEN` | Atlassian → Security → API tokens |

## Troubleshooting

- **`body_storage_value` rejected** - use storage format, not Markdown.
  Wrap text in `<p>…</p>`, paragraphs only; complex macros need the XML
  markers Confluence emits when you export a page.
- **`403`** - the account isn't added to the space. Ask the space admin
  to grant *Add and delete pages*.

## Links

- [Atlassian API tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
- [Confluence REST API](https://developer.atlassian.com/cloud/confluence/rest/v1/intro/)
