Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add metadata when creating a new page via REST API?

Tom Hudgins November 18, 2019

I'm using the Confluence REST API to create new pages. That works great but I now need to add some metadata to a new page and I'm having difficulty with how to do that. Based on the schema for content creation resource, I'm sending this payload in my POST call

{'type':'page',
'title': 'My Title',
'space': 'My Space',
'metadata': { 'userid': 'myid'},
'body': ...
}

Everything works except that when I go to read the page (expanding metadata), I don't see my metadata. All I get is something like this:

"metadata": {
"_expandable": {
"labels": "",
"frontend": "",
"currentuser": "",
"editorHtml": ""
},
"properties": {
"_links": {
"self": "https://<server>/rest/api/content/86945505/property"
}
}

 

I'm not sure what I'm missing. Should I be able to set my own metadata on the page? 

I do see the information about Content Properties but that requires an extra call after the page is created that I was hoping to avoid.

Thanks for any insight

1 answer

0 votes
Prerak Shah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 26, 2021

Yes, I have the similar doubt

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events