XPress · Confluence
REST API
Your documentation lives in Confluence. Your release pipeline, your compliance archive and your customer portal live somewhere else. The XPress REST API brings them together: one call turns a page, or a whole page tree, into the same polished PDF, HTML or Markdown file your team exports from Confluence, with your templates, your cover, your headers and your watermark.
- Release notes in every build. Your CI pipeline exports the release notes page as a PDF and attaches it to the release, every time, with nobody clicking Export.
- An archive that keeps itself. A nightly job exports your policies space and files it where your auditors look.
- Documents in the tools you already use. Your portal, chatbot or internal tool fetches a fresh export whenever it needs one.
Every call is made as you, with your own Confluence permissions. The API can only export pages you can read, and everything your space requires (a locked template, a CONFIDENTIAL watermark) is applied exactly as in Confluence. Scripts and scheduled jobs keep working without you: the integration renews its own access (see below).
Before you start
Section titled “Before you start”A site admin turns the API on
Section titled “A site admin turns the API on”The API is off until a site admin turns it on for your site:
- In Atlassian Administration, go to Apps, then Sites, and choose your site.
- Open Connected apps, then XPress, and its Details.
- Under App REST APIs, select Enable app REST APIs. The base URL of your site’s API is shown there from then on.
Turning it off again stops every call at once. Only verified Atlassian accounts in your organization can create
integrations that use it. For any other account, Atlassian’s consent screen lists no XPress permission, and every
call answers 403 with “Missing required scopes”.
You create an OAuth 2.0 integration
Section titled “You create an OAuth 2.0 integration”The API uses Atlassian’s own sign-in, so there is no extra password or key to look after:
- In the Atlassian developer console, create an OAuth 2.0 integration.
- Under Permissions, add the XPress app and choose the scopes your script needs (see the table below).
Always add
read:forge-app:confluenceas well. - Set a callback URL for your script and complete the authorization code flow once, following
Atlassian’s OAuth 2.0 (3LO) guide and
Access REST APIs exposed by a Forge app.
Add
offline_accessto the scopes you ask for, so the integration can keep working on its own. Atlassian shows you a consent screen that lists exactly what you allow. - Use the access token you receive as a bearer token on every call. It lasts an hour: before it runs out, use the refresh token to get a new one. Every refresh also gives you a new refresh token, so always keep the latest one and use it for the next refresh.
You can revoke the integration at any time in your Atlassian account settings.
The base URL
Section titled “The base URL”Each call goes to one of these two base URLs, followed by the path of the call. Put in your site’s address, or its cloud id; the rest is the same for every site:
https://<your-site>.atlassian.net/gateway/api/svc/confluence/apps/c49b11db-4e33-4df5-83ed-2036530017dd_324ffb0e-16fd-4b13-bf8a-7bc0202e47aahttps://api.atlassian.com/svc/confluence/<cloud-id>/apps/c49b11db-4e33-4df5-83ed-2036530017dd_324ffb0e-16fd-4b13-bf8a-7bc0202e47aaXPress’s app id is c49b11db-4e33-4df5-83ed-2036530017dd and its environment id is
324ffb0e-16fd-4b13-bf8a-7bc0202e47aa. Your site admin also sees your base URL under App REST APIs in the
app’s details once the API is on. Both forms reach the same API. In the examples below, $BASE is your base URL
and $TOKEN your access token.
Routes and scopes
Section titled “Routes and scopes”| Call | What it does | Scopes |
|---|---|---|
POST /exports |
Start an export | write:export:custom, read:forge-app:confluence |
GET /exports/{id} |
Read an export’s status | read:export:custom, read:forge-app:confluence |
GET /exports/{id}/file |
Get a download link for a finished export | read:export:custom, read:forge-app:confluence |
DELETE /exports/{id} |
Cancel a running export, or delete a finished one and its file | write:export:custom, read:forge-app:confluence |
GET /templates?spaceKey=KEY |
List the templates you can choose in a space | read:template:custom, read:forge-app:confluence |
What each scope allows:
- Read your exports (
read:export:custom): the status of exports you started through the API, and a link to download each finished file while you can still open the space it was made in. - Start and delete your exports (
write:export:custom): start exports of pages you can read, and cancel or delete exports you started through the API. - Read export templates (
read:template:custom): the templates you can choose in a space (their names and ids), and which one is its default.
Start an export
Section titled “Start an export”curl -s -X POST "$BASE/exports" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "pageId": "123456", "scope": "descendants", "format": "pdf" }'{ "id": "exp_1764150000000_0a1b2c3d", "status": "queued" }| Field | Required | What it means |
|---|---|---|
pageId |
yes | The id of the page or blog post, as in its address. |
scope |
yes | current for the page alone, descendants for the page and every page under it you can read, in the tree’s order. |
templateId |
no | A template from GET /templates. Without it, XPress uses the space’s default template, or its plain starter when the space has none. |
format |
no | pdf, html or markdown. Without it, the template’s format. |
locale |
no | The language for month and day names, as a language code, alone or with a region (de, de-DE, pt_BR). The codes: en English, de German, fr French, es Spanish, it Italian, nl Dutch, pt Portuguese, pl Polish, sv Swedish, da Danish, nb Norwegian Bokmål, fi Finnish, cs Czech. Any other code answers 400. |
timeZone |
no | The time zone for the dates the template prints, such as Europe/Berlin. |
Anything else in the body is ignored. The export is filed under the page’s own space. When the space locks its
template or requires a watermark, your export gets them, exactly as in Confluence. A format the template or the
space locks is used whatever format asks for, and Markdown becomes a PDF where the space requires a watermark or
a lock holds something Markdown cannot carry.
Check its status
Section titled “Check its status”curl -s "$BASE/exports/exp_1764150000000_0a1b2c3d" -H "Authorization: Bearer $TOKEN"{ "id": "exp_1764150000000_0a1b2c3d", "status": "running", "progress": 40, "message": "Exporting page 3 of 8...", "createdAt": "2026-11-26T10:00:00.000Z"}status is one of queued, running, done, failed and cancelled. Most exports are done within a minute;
checking every few seconds is plenty.
Download the file
Section titled “Download the file”curl -s "$BASE/exports/exp_1764150000000_0a1b2c3d/file" -H "Authorization: Bearer $TOKEN"{ "url": "https://...", "expiresAt": "2026-11-26T11:00:00.000Z", "fileName": "Release notes.pdf", "contentType": "application/pdf"}Download the file from url with a plain GET, no headers needed:
curl -s -o "Release notes.pdf" "<url>"The link works for one hour, and anyone who has it can download the file in that hour, so keep it as safe as the file itself. Ask for a new link whenever you need one. A link is only given while you can still open the space the export was made in.
Cancel or delete an export
Section titled “Cancel or delete an export”curl -s -X DELETE "$BASE/exports/exp_1764150000000_0a1b2c3d" -H "Authorization: Bearer $TOKEN"A queued or running export is cancelled (202, status cancelled), and no file of it is ever given out. One
still queued or running 15 minutes after it started is deleted instead (200, status deleted). A finished or
failed export is deleted with its file (200, status deleted), and from then on every call on it answers 404.
No file of a cancelled or deleted export is ever given out. Finished exports are also removed on their own after
30 days.
List templates
Section titled “List templates”curl -s "$BASE/templates?spaceKey=DOCS" -H "Authorization: Bearer $TOKEN"{ "templates": [ { "id": "tpl_starter_simple", "name": "Simple", "isSpaceDefault": false }, { "id": "tpl_1760000000000_ab12", "name": "Company report", "isSpaceDefault": true } ]}These are the templates you can choose for an export in that space, the space’s default among them. Use the
space key exactly as Confluence shows it, capital letters included: DOCS and docs are not the same key.
What the API sees, and its limits
Section titled “What the API sees, and its limits”- Only your own API exports. The API sees the exports you started through it, and nobody else’s. Exports you start in Confluence are not listed or changed by the API.
- Visible in the space, like any export. Exports your scripts start appear in the space’s export history in Confluence exactly like exports started there: every member of the space sees that it ran, when, who started it and its status; its page count, its messages and its file are yours alone. The space’s history reaches back 30 days. Your own export list in Confluence shows them too.
- Your permissions, always. Pages you cannot read are never exported, and a page you cannot read is answered exactly like a page that does not exist.
- Your organization’s policies too. In a space your organization admin keeps apps out of (a data security
policy), a page is answered like one that does not exist. An export made there before the policy has status
failed, a message that says why, and no file (404) while the policy stands; if the space opens again within its 30 days, it readsdoneagain. - Shared limits. The API shares your export limits with Confluence: three exports running at once and twenty
started in five minutes. An export you delete still counts toward the twenty until its five minutes have
passed. Past them the API answers
429with aRetry-Afterheader. - One hour links. Every download link expires after one hour.
- Large trees. A tree too large for one export is refused with
413: export one branch at a time.
Errors
Section titled “Errors”Atlassian answers some calls before they reach XPress, in its own format: 401 for a missing, expired or revoked
token (refresh it, or authorize the integration again), 403 while App REST APIs are off on the site (ask your
site admin to turn them on), 403 with “Missing required scopes” when the token does not carry the XPress scope
the call needs (add it to the integration, or see who can create integrations, above), and 404 for a path that is
not one of the routes above.
Errors XPress answers are JSON with a fixed code and message:
| Status | code |
What to do |
|---|---|---|
| 400 | bad_request |
Check the body and the parameters. |
| 401 | unauthorized |
Authorize the integration again. |
| 402 | licence_inactive |
Ask your site admin to renew XPress. |
| 403 | forbidden |
Ask your site admin for access to XPress on this site. |
| 404 | not_found |
The page, space, template or export does not exist, or you cannot use it. |
| 409 | not_ready |
The export has no file yet. Check its status. |
| 413 | too_large |
Export fewer pages at a time. |
| 429 | rate_limited |
Wait for the time in Retry-After and try again. |
| 500, 503 | error, unavailable |
Try again shortly. |
The full reference is in the OpenAPI description.