> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create post comment

Any user associated with a context with `AUTHENTICATED` scope can add a comment to the own post or
to a post created by any user from the network by executing of the `createPostComment` mutation.
The current API user will be set as an author.

Mutation has a single required incoming argument - `data` that represents `PostCommentCreationInput` object:

| Parameter      | Type                                                                                     | Description                                                                                                                                                                                                                                                                                                                   |
| :------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `text`         | `String`                                                                                 | **Required**. The comment body text. Available HTML tags are: `<a>`, `<p>`, `<br>`. Any other tag will be trimmed.                                                                                                                                                                                                            |
| `parentPostId` | `ID`                                                                                     | **Required**. ID of the post that should be commented. **Warning**: once the comment was created, this property cannot be updated.                                                                                                                                                                                            |
| `imagesBase64` | [\[`UploadedFileInput`\]](/OpignoEnterpriseAPI/Post/CreatePost#uploadedfileinput-object) | The list of comment images, each one should be formatted as base64 string. Up to 10 images can be shared, max file size - 20Mb. Allowed extensions: png, jpg, jpeg, gif. Leave empty to not attach any images to the post. **Warning**: once the comment was created, this property cannot be updated.                        |
| `filesBase64`  | [\[`UploadedFileInput`\]](/OpignoEnterpriseAPI/Post/CreatePost#uploadedfileinput-object) | The list of post comment, each one should be formatted as base64 string. Up to 10 files can be shared, max file size - 20Mb. Allowed extensions: txt, pdf, doc, docx, xls, xlsx, ppt, pptx, svg. Leave empty to not attach any files to the post. **Warning**: once the comment was created, this property cannot be updated. |

<Note>
  Extra content (like a training, a certificate or a badge) cannot be shared in a comment.
  Also, you cannot add a comment to another comment (only posts can be commented).
</Note>

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation createPostComment {
      createPostComment(data: {
        text: "This is a post comment.",
        parentPostId: 175,
      }) {
        response {
          id
          text
          created
          parentPost {
            id
          }
          authorUserContext {
            id
            uuid
          }
          cta {
            actionId
            title
            arguments {
              key
              value
            }
          }
        }
        errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
    {
      "data": {
        "createPostComment": {
          "response": {
            "id": "176",
            "text": "<p>This is a post comment.</p>\n",
            "created": 1751647343,
            "parentPost": {
              "id": "175"
            },
            "authorUserContext": {
              "id": "915",
              "uuid": "5acfc440-88e0-4286-b089-c0f03575ed9a"
            },
            "cta": [
              {
                "actionId": "EDIT_POST",
                "title": "Edit the comment",
                "arguments": [
                  {
                    "key": "postId",
                    "value": "176"
                  }
                ]
              },
              {
                "actionId": "DELETE_POST",
                "title": "Delete the comment",
                "arguments": [
                  {
                    "key": "postId",
                    "value": "176"
                  }
                ]
              },
              {
                "actionId": "TOGGLE_LIKE",
                "title": "Toggle like",
                "arguments": [
                  {
                    "key": "postId",
                    "value": "176"
                  }
                ]
              }
            ]
          },
          "errors": []
        }
      }
    }
  ```
</CodeGroup>

The mutation returns a `Post` object. Detailed description and the full list of available properties can be found [here](/OpignoEnterpriseAPI/Post/GetPost).
