Automating Confluence Page Updates with the REST API: A Practical Guide
Learn how to automate Confluence meeting‑notes pages with the REST API, covering authentication, payload design, version handling, a curl example, and verification steps.
01 Sept 2025, 19:31 UTC

The problem: keeping meeting notes current
Many teams copy meeting notes into Confluence by hand. This manual step is tedious, prone to typos, and often leads to outdated pages when someone forgets to update after a call.
Thesis: a simple REST‑API script can create or refresh a meeting‑notes page reliably
By using Confluence’s REST API you can automate the whole flow: authenticate, build a JSON payload, handle version numbers, and verify the result. The approach works for both Cloud and Server/Data Center instances.
1. Authentication basics
For most automation scripts the easiest method is basic auth with an email address and an API token. Encode the string email:api_token in Base64 and send it in the Authorization header.
Authorization: Basic dGVzdEBleGFtcGxlLmNvbTpBUEktVG9rZW4xMjM=
If you are building an internal app, OAuth 2.0 (app‑to‑app) is also supported, but the basic‑auth method is sufficient for quick scripts.
2. Payload structure for creating a page
The endpoint /wiki/rest/api/content expects a JSON object with these required fields:
type: always"page"for a Confluence page.title: the page title you want.space: an object withkeyset to the space where the page lives.body: an object using thestoragerepresentation; the HTML‑like markup goes invalue.
Example minimal payload:
{
"type": "page",
"title": "Meeting Notes",
"space": {"key": "DEV"},
"body": {
"storage": {
"value": "Meeting held on 2026-10-19.
",
"representation": "storage"
}
}
}
3. Version handling when updating
Confluence uses optimistic locking. To update an existing page you must:
- GET the current version:
GET /wiki/rest/api/content/{id}?expand=version - Extract
version.number, increment it by one. - Include the new version number in the update payload under
version.number.
If you send a stale version number, the API returns HTTP 400 with a message about a version conflict, protecting you from overwriting concurrent edits.
4. Worked example: creating a meeting‑notes page with curl
The following command creates a page in the DEV space, adds a simple table for action items, and prints the newly created page ID. Replace placeholders with your own values.
#!/usr/bin/env bash
# Variables – set these before running
EMAIL="[contact removed]"
API_TOKEN="YOUR_API_TOKEN"
BASE_URL="https://your-instance.atlassian.net/wiki"
SPACE_KEY="DEV"
AUTH=$(printf "%s:%s" "$EMAIL" "$API_TOKEN" | base64)
PAYLOAD=$(cat <<'EOF'
{
"type": "page",
"title": "Meeting Notes – $(date +%Y-%m-%d)",
"space": {"key": "$SPACE_KEY"},
"body": {
"storage": {
"value": "Action Items
Owner Task Due
",
"representation": "storage"
}
}
}
EOF
)
RESPONSE=$(curl -s -w "\nHTTP_STATUS:%{http_code}" \
-X POST "$BASE_URL/rest/api/content" \
-H "Authorization: Basic $AUTH" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
HTTP_STATUS=${RESPONSE##*HTTP_STATUS:}
BODY=${RESPONSE%HTTP_STATUS:*}
if [[ "$HTTP_STATUS" -eq 200 ]]; then
PAGE_ID=$(echo "$BODY" | grep -o '"id":"[^"]*' | cut -d'"' -f4)
echo "Page created successfully. ID: $PAGE_ID"
else
echo "Failed to create page. HTTP $HTTP_STATUS"
echo "Response: $BODY"
fi
Run the script on a machine with curl and bash. No special privileges are needed beyond having a valid API token.
5. Limitations and verification
Rate limits: Confluence Cloud caps REST calls at roughly 100 requests per minute per app. Exceeding this yields HTTP 429. Implement exponential back‑off or a simple sleep (e.g., 600 ms between calls) to stay safe.
Version‑check risk: Skipping the GET‑before‑PUT step can cause silent overwrites. Always fetch the latest version, increment it, and include it in the payload.
To verify that the page was created correctly:
- Check the creation response for a 200 OK and an
idfield. - GET
/wiki/rest/api/content/{id}and confirm thetitleandbody.storage.valuematch what you sent. - For an update test, perform a GET to obtain the current version, send a PUT with
version.number+1, then repeat the PUT with the same version number; the second call should return 400.
Actionable next steps
1. Generate an API token from your Confluence profile (Security → API tokens).
2. Store the token and your email in a secure vault or environment variable—never hard‑code them.
3. Use the script above as a starter; adapt the value field to include your meeting agenda template.
4. Add a cron job or CI step that runs the script after each meeting to keep the page fresh.
5. Monitor the response codes; if you see 429, increase the delay between requests.
By following these steps you replace a manual, error‑prone process with a repeatable API‑driven workflow that scales as your team grows.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.