Unable to add comment on confluence page

Hi
I am trying to use this API to add a comment on on our page but i am unable to get this to work.
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-comment/#api-footer-comments-post

I have tried with this payload but it did not work and i am getting 500 Internal server error.

# payload = {
        #     "pageId": f"{page_id}",
        #     "body": {
        #         "value": '{\r\n  "version": 1,\r\n  "type": "doc",\r\n  "content": [\r\n    {\r\n      "type": "paragraph",\r\n      "content": [\r\n        {\r\n          "type": "text",\r\n          "text": "Hello "\r\n        },\r\n        {\r\n          "type": "text",\r\n          "text": "world",\r\n          "marks": [\r\n            {\r\n              "type": "strong"\r\n            }\r\n          ]\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}',
        #         "representation": "atlas_doc_format",
        #     },
        # }

How do i add a comment on the confluence page? Could you provide a correct payload to add a comment?
This is our URL. https://{URL}/wiki/spaces/{group_name}/pages/{page_id}/{page_title}

Try this payload, this is working for my case

{
  "pageId": pageId,
  "body": {
    "representation": "atlas_doc_format",
    "value": "{\"type\": \"doc\", \"content\": [{\"type\": \"paragraph\", \"content\": [{\"type\": \"text\", \"text\": \"foo 3\"}]}]}"
  }
}