Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Create/modify confluence property through REST API fails Edited

Attempting to create/update confluence property from a Built in Macro:

Reading(GET) of parameter works fine, but PUT/POST fails w:

Fail: {"statusCode":500,"message":"","reason":"Internal Server Error"}

During debugging the property was created using the REST API Browser, the parameter was also successfully modified using a modified response from a request.

The example from REST API manual was used:{id}/property-create

{ "key": "example-property-key", "value": { "anything": "goes" } }

When attempting same from macro it fails (GET successful)

AJS.$(document).on('click', '#button_$paramChartID', function() {

contentType: 'application/json',
type: 'GET',
url: confbase + "/rest/api/content/" + AJS.params.contentId + "/property/example-property-key",
}).done(function(response) {
AJS.log("Response: " + JSON.stringify(response));
AJS.log("Response.key: " + response.key);
response.value.anything = "goes" + response.version.number;
response.version.number = response.version.number + 1;
contentType: 'application/json',
type: 'PUT',
data: response,
url: confbase + "/rest/api/content/" + AJS.params.contentId + "/property/example-property-key",
}).done(function(response2) {
AJS.log("Response: " + JSON.stringify(response2));
AJS.log("Response.key: " + response2.key);
}).fail(function (xhr) {
AJS.log("Fail: " + xhr.responseText);

}).fail(function (xhr) {
AJS.log("Fail: " + xhr.responseText);



Similar problems encountered using jQuery PU and POST before (unresolved/no response)

Confluence server 6.15, JIRA Server 8.3

1 answer

1 accepted

0 votes
Answer accepted
Dario B Atlassian Team Nov 12, 2019

Hello @zaphnet ,

If you are using Confluence Server then the issue here seems to be with the endpoint called.

Indeed, in your script I can see:

url: confbase + "/rest/api/content/" + AJS.params.contentId + "/property/example-property-key"


While the correct endpoint to be called for Confluence Server (from the documentation page you are pointing to) is:

/rest/content/{id}/property/{key} (there is no '/api/' in the endpoint for Server)


The endpoint you are using seems to be similar to the one used in Confluence Cloud REST API



Please let me know if this helps. In case it doesn't, please try to send the same request body to the same endpoint (using the same credentials if possible) with Curl and paste the response you get in here (making sure to remove the sensitive data). 



Thanks for the response, but it did not help.

At the top of the documentation it is mentioned:


Tried your suggestion, but then I only get a "page not found".

With the code above I can read the json file stored(created with postman and with "rest/api/".

AJS.toInit(function() {

contentType: 'application/json',
type: 'GET',
url: confbase + "/rest/api/content/" + 42238001 + "/property/example-property-key",
}).done(function(response) {
AJS.log("Response: " + JSON.stringify(response));
AJS.log("Response.key: " + response.key);
}).fail(function (xhr) {
AJS.log("Fail: " + xhr.responseText);
Response.key: example-property-key

Accessing directly url:



 All the edits/changes to the property has been through postman (successfully)

The PUT fails with 500 + "Internal Server Error".

In the "on click" example above I successfully read the json object, modify it and successfully use the json object with postman - but this Ajax PUT fails...


The confluence rest api documentation has not been updated since 6.6.0 

Hi @zaphnet , 

You are totally right, I have indeed found an old request to fix the documentation that has never been taken into account since it was reported as a suggestion instead of a bug:

I have now changed it to bug and update the description. I will get in touch with DEV soon to ask to have this fixed asap.


For the rest, if I understand correctly you are able to GET and PUT the endpoint using POSTMAN (or Curl) but the same action fails when you try to do so from your code. 

Can you kindly confirm this is the case?

If this is the case then it would be a good idea to run it once again and check Confluence logs if you can find more information on what is failing (you can paste the error message here making sure to remove the sensitive data).


P.S. Apologies for the mistake, I usually work with Jira Cloud REST API and I am now slowly starting with Confluence Server. My knowledge is not that solid yet. 



The GET and PUT/POST Works OK from postman/curl.

Get works OK from my built in JS script code, PUT/POST fails.

I'm admin in Confluence+JIRA, but not on the servers - I will check if I can get a hold of any log-files from the Server.

I'm a novice working with JS and Ajax, mostly been working with Golang scripts when accessing the REST API.



Dario B Atlassian Team Nov 14, 2019

Hi @zaphnet ,

As written in the other thread: 

Hopefully you can get the logs. Otherwise, in case you cannot, if the GET works and the PUT fails, we can make the assumption that there is either something wrong with the code for the PUT request or with the provided body (but that should return error 400).

In this case one option would be to ask in the developers' community to check the code:


Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you