> ## 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.

# Edit post/comment

Posts and comments are basically the same entity. Opigno Enterprise API provides the `editPost` mutation to update the post text.
The post can be edited **only** by the author.

<Note>
  Only a text can be updated. Shared content cannot be changed.
</Note>

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

| Parameter | Type     | Description                                                                                                     |
| :-------- | :------- | :-------------------------------------------------------------------------------------------------------------- |
| `postId`  | `ID`     | **Required**. ID of the post/comment that should be edited.                                                     |
| `text`    | `String` | **Required**. The post body text. Available HTML tags are: `<a>`, `<p>`, `<br>`. Any other tag will be trimmed. |

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation editPost {
      editPost(data: {
        postId: 175,
        text: "Updated"
      }) {
        response {
          id
          text
        }
        errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
    {
      "data": {
        "editPost": {
          "response": {
            "id": "175",
            "text": "<p>Updated</p>\n"
          },
          "errors": []
        }
      }
    }
  ```
</CodeGroup>

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