Anyone able to create comments using the content REST API

We’ve tried this payload to the API documented here

    body: {
       view: {
          "representation": "string",
          "value": "some comment"
    space: { key: "EXAMPLE" },
    type: "comment",
    ancestors: [{
        id: 1234

but we get a response saying that a container property needs to be sent in the payload too but that doesn’t appear to be documented anywhere…

Hi @jbevan,

Seems like a gap in the documentation. I was able to create a comment by adding a container like this:

  "type": "comment",
  "space": {
    "key": "test2"
  "body": {
    "storage": {
      "representation": "storage",
      "value": "<p>A new comment</p>"
  "title": "Test comment",
  "container": {
    	"id": 10649626,
        "type" : "global"

As for the container object, this might help describe it a bit:

  "additionalProperties": false,
  "description": "The new content to add the comment to.",
  "properties": {
    "id": {
      "description": "The `id` of the parent content.",
      "type": "string"
    "type": {
      "description": "The content type.",
      "type": "string"
  "required": ["id", "type"],
  "type": "object"

Also, I reported this ( by clicking the “Give docs feedback” link on the upper right hand corner of the page.

Hope this helps.


Ah great, thank you!

1 Like

description": “The id of the parent content.”,
What exactly is the ‘parent content’ ? If I got a link like:
~819268686 - is the space id;
753401960 - is the content/page id;
What is the parent content?

Hello @VictorDragnea, the parent content should be the contentId of the content you want to comment to.

1 Like

Figured it out. Thank you!

1 Like