Setting up API access requires three one-time steps: enabling the feature on your Atlassian site, creating an OAuth 2.0 integration and connecting it to the app, then completing the authorization flow to obtain an access token.
Note: App REST APIs on Forge are disabled by default and must be explicitly enabled by a site or org admin. See the official Atlassian documentation for a full walkthrough.
This step must be completed by a site or org admin and only needs to be done once per Confluence site.
Once enabled, the base URL for the API is displayed under this toggle.
Only site members can create OAuth 2.0 integrations that connect to that site's Forge app APIs.
Markdown Exporter API)export:markdown:customread:forge-app:confluenceBoth scopes must be present before you authorize. Use only the minimum scopes required.
https://httpbin.org/anything works — the auth code will appear in the redirect response JSON.code query parameter from the URLIf you need
offline_access(refresh token for automated pipelines), append%20offline_accessto thescopeparameter in the authorization URL before opening it.
curl --request POST \
--url 'https://auth.atlassian.com/oauth/token' \
--header 'Content-Type: application/json' \
--data '{
"grant_type": "authorization_code",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"code": "CODE_FROM_REDIRECT",
"redirect_uri": "YOUR_CALLBACK_URL"
}'
Your Client ID and Client Secret are available in the Settings tab of your OAuth integration.
Response:
{
"access_token": "eyJ...",
"refresh_token": "eyJ...",
"expires_in": 3600,
"token_type": "Bearer"
}
Store both tokens. The access_token is valid for 1 hour. Use the refresh_token to obtain new access tokens without user interaction — see Authentication for rotation details.
Your Cloud ID is required to construct the API URL:
GET https://your-site.atlassian.net/_edge/tenant_info
It is also displayed in the REST API tab inside the app settings: Confluence Admin → Apps → Markdown Exporter → REST API.
Two URL formats are supported:
https://api.atlassian.com/svc/confluence/{cloudId}/apps/{appId}_{envId}/{path}
https://{site-name}/gateway/api/svc/confluence/apps/{appId}_{envId}/{path}
| Field | Value |
|---|---|
| App ID | 0def1d4f-1593-4dd0-99a3-a098b3959067 |
| Production env ID | 796457c9-9c03-4382-b44f-d19571068ece |
| Staging env ID | 73c9d7be-47c5-479a-b08d-14fb79453df8 |
| Dev env ID | 08a10a13-932b-47bb-b760-0cc1e93d4a50 |
curl --request POST \
--url "https://api.atlassian.com/svc/confluence/{cloudId}/apps/0def1d4f-1593-4dd0-99a3-a098b3959067_796457c9-9c03-4382-b44f-d19571068ece/singleExport" \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"pageId": "123456"}' \
> my-page.md
A successful response returns the page's Markdown content as plain text.