Can't update page draft via REST API v2

Hi Atlassian,

I’m trying to update page drafts via v2 API like this.

              await requestConfluence(`/wiki/api/v2/pages/${pageId}`, {
                method: 'PUT',
                headers: {
                  Accept: 'application/json',
                  'Content-Type': 'application/json',
                },
                body: JSON.stringify({
                  id: pageId,
                  status: 'draft',
                  title: title,
                  spaceId: spaceId,
                  version: {
                    number: 1,
                  },
                  body: body,
                }),
              });

However, I’m getting an 409 error below.
(I tried with version number = current version + 1. But, it didn’t work as well)

I confirmed we can update draft pages via v1 API like this.

              await requestConfluence(`/wiki/rest/api/content/${pageId}?status=draft`, {
                method: 'PUT',
                headers: {
                  Accept: 'application/json',
                  'Content-Type': 'application/json',
                },
                body: JSON.stringify({
                  id: pageId,
                  type: 'page',
                  status: 'draft',
                  title: title,
                  spaceId: spaceId,
                  version: {
                    number: 1,
                  },
                  body: body,
                }),
              });

How can I update page draft via V2 API?

Regards,
Takafumi

3 Likes

Raised the issue with Atlassian here: https://jira.atlassian.com/browse/CONFCLOUD-76640

3 Likes