---
title: "Create inline comment"
method: POST
path: "/inline-comments"
tags: ["Comment"]
---

# Create inline comment

`POST /inline-comments`

Create an inline comment. This can be at the top level (specifying pageId or blogPostId in the request body)
or as a reply (specifying parentCommentId in the request body). Note the inlineCommentProperties object in the
request body is used to select the text the inline comment should be tied to. This is what determines the text 
highlighting when viewing a page in Confluence.

**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
Permission to view the content of the page or blogpost and its corresponding space. Permission to create comments in the space.

## Request body

- CreateInlineCommentModel
  - `blogPostId` string — ID of the containing blog post, if intending to create a top level footer comment. Do not provide if creating a reply.
  - `pageId` string — ID of the containing page, if intending to create a top level footer comment. Do not provide if creating a reply.
  - `parentCommentId` string — ID of the parent comment, if intending to create a reply. Do not provide if creating a top level comment.
  - `body` union
    - CommentBodyWrite
      - `representation` 'storage' | 'atlas_doc_format' | 'wiki' — Type of content representation used for the value field.
      - `value` string — Body of the comment, in the format found in the representation field.
    - CommentNestedBodyWrite — Body of the comment. Only one body format should be specified as the property for this object, e.g. `storage`.
      - `storage` CommentBodyWrite
        - `representation` 'storage' | 'atlas_doc_format' | 'wiki' — Type of content representation used for the value field.
        - `value` string — Body of the comment, in the format found in the representation field.
      - `atlas_doc_format` CommentBodyWrite
        - `representation` 'storage' | 'atlas_doc_format' | 'wiki' — Type of content representation used for the value field.
        - `value` string — Body of the comment, in the format found in the representation field.
      - `wiki` CommentBodyWrite
        - `representation` 'storage' | 'atlas_doc_format' | 'wiki' — Type of content representation used for the value field.
        - `value` string — Body of the comment, in the format found in the representation field.
  - `inlineCommentProperties` object — Object describing the text to highlight on the page/blog post. Only applicable for top level inline comments (not replies) and required in that case.
    - `textSelection` string — The text to highlight
    - `textSelectionMatchCount` integer — The number of matches for the selected text on the page (should be strictly greater than textSelectionMatchIndex)
    - `textSelectionMatchIndex` integer — The match index to highlight. This is zero-based. E.g. if you have 3 occurrences of "hello world" on a page and you want to highlight the second occurrence, you should pass 1 for textSelectionMatchIndex and 3 for textSelectionMatchCount.

## Response `201`

Returned if the inline comment is created.

- object
  - `id` string — ID of the comment.
  - `status` 'current' | 'draft' | 'archived' | 'historical' | 'trashed' | 'deleted' | 'any' — The status of the content.
  - `title` string — Title of the comment.
  - `blogPostId` string — ID of the blog post containing the comment if the comment is on a blog post.
  - `pageId` string — ID of the page containing the comment if the comment is on a page.
  - `parentCommentId` string — ID of the parent comment if the comment is a reply.
  - `version` Version
    - `createdAt` string, date-time — Date and time when the version was created. In format "YYYY-MM-DDTHH:mm:ss.sssZ".
    - `message` string — Message associated with the current version.
    - `number` integer — The version number.
    - `minorEdit` boolean — Describes if this version is a minor version. Email notifications and activity stream updates are not created for minor versions.
    - `authorId` string — The account ID of the user who created this version.
  - `body` BodySingle — Contains fields for each representation type requested.
    - `storage` BodyType
      - `representation` string — Type of content representation used for the value field.
      - `value` string — Body of the content, in the format found in the representation field.
    - `atlas_doc_format` BodyType
      - `representation` string — Type of content representation used for the value field.
      - `value` string — Body of the content, in the format found in the representation field.
    - `view` BodyType
      - `representation` string — Type of content representation used for the value field.
      - `value` string — Body of the content, in the format found in the representation field.
  - `resolutionLastModifierId` string — Atlassian Account ID of last person who modified the resolve state of the comment. Null until comment is resolved or reopened.
  - `resolutionLastModifiedAt` string, date-time — Timestamp of the last modification to the comment's resolution status. Null until comment is resolved or reopened.
  - `resolutionStatus` 'open' | 'reopened' | 'resolved' | 'dangling' — Inline comment resolution status
  - `properties` object
    - `results` ContentProperty[]
      - `id` string — ID of the property
      - `key` string — Key of the property
      - `value` unknown
      - `version` Version
        - `createdAt` string, date-time — Date and time when the version was created. In format "YYYY-MM-DDTHH:mm:ss.sssZ".
        - `message` string — Message associated with the current version.
        - `number` integer — The version number.
        - `minorEdit` boolean — Describes if this version is a minor version. Email notifications and activity stream updates are not created for minor versions.
        - `authorId` string — The account ID of the user who created this version.
    - `meta` OptionalFieldMeta
      - `hasMore` boolean — Indicates if there are more available results that can be fetched.
      - `cursor` string — A token that can be used in the query parameter of the endpoint returned in the `_links` property to retrieve the next set of results.
    - `_links` OptionalFieldLinks
      - `self` string — A relative URL that can be used to fetch results beyond what this include parameter retrieves.
    - `inlineMarkerRef` string — Property value used to reference the highlighted element in DOM.
    - `inlineOriginalSelection` string — Text that is highlighted.
  - `operations` object
    - `results` Operation[]
      - `operation` string — The type of operation.
      - `targetType` string — The type of entity the operation type targets.
    - `meta` OptionalFieldMeta
      - `hasMore` boolean — Indicates if there are more available results that can be fetched.
      - `cursor` string — A token that can be used in the query parameter of the endpoint returned in the `_links` property to retrieve the next set of results.
    - `_links` OptionalFieldLinks
      - `self` string — A relative URL that can be used to fetch results beyond what this include parameter retrieves.
  - `likes` object
    - `results` Like[]
      - `accountId` string — Account ID.
    - `meta` OptionalFieldMeta
      - `hasMore` boolean — Indicates if there are more available results that can be fetched.
      - `cursor` string — A token that can be used in the query parameter of the endpoint returned in the `_links` property to retrieve the next set of results.
    - `_links` OptionalFieldLinks
      - `self` string — A relative URL that can be used to fetch results beyond what this include parameter retrieves.
  - `versions` object
    - `results` Version[]
      - `createdAt` string, date-time — Date and time when the version was created. In format "YYYY-MM-DDTHH:mm:ss.sssZ".
      - `message` string — Message associated with the current version.
      - `number` integer — The version number.
      - `minorEdit` boolean — Describes if this version is a minor version. Email notifications and activity stream updates are not created for minor versions.
      - `authorId` string — The account ID of the user who created this version.
    - `meta` OptionalFieldMeta
      - `hasMore` boolean — Indicates if there are more available results that can be fetched.
      - `cursor` string — A token that can be used in the query parameter of the endpoint returned in the `_links` property to retrieve the next set of results.
    - `_links` OptionalFieldLinks
      - `self` string — A relative URL that can be used to fetch results beyond what this include parameter retrieves.
  - `_links` object
    - `webui` string — Web UI link of the content.
    - `base` string — Base url of the Confluence site.

## Other responses

- `400` — Returned if an invalid request is provided.
- `401` — Returned if the authentication credentials are incorrect or missing from the request.
- `404` — Returned if: - The page/blog post was not found - The calling user does not have permission to view the parent page/blog post - The user is forbidden from creating a comment tied to a resource they are allowed to view

---

[API](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api-v2.md) · [All operations](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/the-confluence-cloud-rest-api-v2/revisions/c4bd1ed570f2/schema)
