As more of our users get into Loom and start using it to create Meeting Note pages in Confluence I have found that we really need some way to "auto-convert" these Live Docs to Pages after a set period of inactivity. This would allow us to better preserve the meeting notes for archival purposes while preventing accidental edits to historical meeting notes.
I understand why meeting note pages should be Live Docs before, during, and shortly after the meeting but forever keeping them as Live Docs will lead to accidental edits when we should have a bit more control over these things.
From my research I have found that there is no public API endpoint that we can use for this, and of course there are no Confluence automation actions that can convert pages and Live Docs.
That being said, thanks to @Darryl Lee and his amazing session during the last Builder's Summit, I was able to determine that the "hidden/unofficial" endpoint for this is:
https://<your-domain>.atlassian.net/cgraphql?q=usePublishUpdatePageMutationIt seems like the payload for this is a GraphQL mutation named usePublishUpdatePageMutation with variables including:
contentId
contentType
content (the page body in Atlassian's doc format)
spaceKey, title, version, etc.
BUT..... It appears that the request is made with the user's browser session/cookies and CSRF tokens. Meaning you cannot call this endpoint with a standard API token or from automation rules...
However, I am relatively new to these things, and would love if anyone in the community here might be able to think of workarounds to this (or just tell me that I am wrong and you totally CAN use API tokens for this).
So, I have some good news, and some bad news.
Good news: You can convert a Live Doc to a Published Page using an API Token!
And... yeah, you just need to give the endpoint the variables you found.
Bad news:
Getting the data for those variables (content, version), is proving harder than expected. At least not without making ANOTHER Web Request to the REST APIs, which I was really hoping to avoid, and I even made some progress, as documented in CONFCLOUD-83388 - Add a smart value to retrieve the full body/content of a Confluence page in Automation
So... yeah, still some work to do, but in the meantime...
How I figured this out:
As I shared at Builder's Summit, DevTools are your friend. And also curl.
So once I get my curl command, I put it in a text editor add my username/token:
-u myemail@whereever.com:mytoken \
And then start deleting stuff, and seeing if the curl command works to convert OTHER test Live Docs, which means changing the contentId:
--data-raw $'[{"operationName":"usePublishUpdatePageMutation","variables":{"contentId":"1979514881"
Then I copy-paste what's left and see if it works. There was definitely some trial and error, like when I didn't update the Title, I got this error:
[{"data":{"confluence_updatePage":{"success":false,"content":null,"errors":[{"message":"A page with this title already exists","extensions":[],"__typename":"MutationError"}],"__typename":"ConfluenceUpdatePagePayload"}}}]
Or when I didn't increment the version:
[{"data":{"confluence_updatePage":{"success":false,"content":null,"errors":[{"message":"Version must be incremented on update. Current version is: 1","extensions":[],"__typename":"MutationError"}],"__typename":"ConfluenceUpdatePagePayload"}}}]
But as you can see, the vast majority of the headers are NOT required.
So yeah, I just changing Title, and Version would let me "convert" any Live Doc to a published page, but unless I also copied the Content, it would be writing over it with the Content of my test page. So not "really" a conversion (unlike the endpoint that lets you convert a page to a Live Doc - so easy.)
Anyways, we're getting there, but I really don't want to have to make an that extra Web Request just to get Content and Version that is already there.
Hello @Zachary Howard
I think you’ve already reached the key conclusion: there does not seem to be a supported way to auto-convert Live Docs to Pages today using standard Confluence automation or a public API.
@Darryl Lee suggestion is still worth testing though. As he noted, some Atlassian endpoints that look browser-based do sometimes still work with a normal API token, so it may be possible to experiment with this in a non-production environment first.
That said, since this appears to rely on an undocumented internal endpoint and may require sending the full page payload, I’d treat it as fragile rather than a long-term solution.
If Atlassian doesn’t add official support for this, it really sounds like a good feature request for Live Doc lifecycle / archival control.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Heyyyy, @Zachary Howard !
Yeah, it seems that it uses browser cookies, but a hidden secret about Atlassian is that if the endpoint is YOURHOST.atlassian.net, there's a pretty good chance a regular API token will work. You just need to try it!
Which... I did, back in November:
How can I use Automation to convert a page into a live doc?
(Ok this is going the other direction, but it's very likely your endpoint will also work.)
ALSO, when somebody else followed-up and had problems, I went and tested my test rule again, and... it still works!
Looking what you found, ugh, that would kind of suck if you have to include Title and Content and everything else. Let me take a look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.