Going Stellar

Home/Atlassian REST API reference

Jira and Confluence Cloud REST API

Add, read, edit and delete Jira comments with the REST API

Comments live under /rest/api/3/issue/{issueIdOrKey}/comment. A POST creates one, a GET lists them with startAt/maxResults paging, and PUT and DELETE work on /comment/{id}. On v3 the body has to be an Atlassian Document Format object; a plain string is rejected, which is the usual first failure.

Endpoints

MethodPathWhat it does
POST/rest/api/3/issue/{issueIdOrKey}/commentAdds a comment to a work item.
GET/rest/api/3/issue/{issueIdOrKey}/commentLists the comments of a work item, paged.
GET/rest/api/3/issue/{issueIdOrKey}/comment/{id}Returns one comment.
PUT/rest/api/3/issue/{issueIdOrKey}/comment/{id}Replaces the body of a comment.
DELETE/rest/api/3/issue/{issueIdOrKey}/comment/{id}Deletes a comment.

Examples

POST /rest/api/3/issue/{issueIdOrKey}/comment

Creates a comment on v3. The body is an ADF document with one paragraph.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "body": {
    "type": "doc",
    "version": 1,
    "content": [
      {
        "type": "paragraph",
        "content": [
          {
            "type": "text",
            "text": "First comment through the REST API."
          }
        ]
      }
    ]
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'body': {'type': 'doc',
                   'version': 1,
                   'content': [{'type': 'paragraph',
                                'content': [{'type': 'text',
                                             'text': 'First comment through the REST API.'}]}]}},
)
print(r.status_code, r.text)

Response: HTTP 201

{
 "id": "11103",
 "body": {
  "type": "doc",
  "version": 1,
  "content": [
   {
    "type": "paragraph",
    "content": [
     {
      "type": "text",
      "text": "First comment through the REST API."
     }
    ]
   }
  ]
 },
 "created": "2026-11-29T19:29:55.626+0200",
 "updated": "2026-11-29T19:29:55.626+0200",
 "jsdPublic": true
}

Response headers

X-Ratelimit-Limit: 200
X-Ratelimit-Remaining: 199

Sent to Atlassian Cloud on .

POST /rest/api/2/issue/{issueIdOrKey}/comment

The same call on v2, where the body is a string in wiki markup.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "body": "A *bold* comment through v2."
}' \
  'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/comment'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/comment',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'body': 'A *bold* comment through v2.'},
)
print(r.status_code, r.text)

Response: HTTP 201

{
 "id": "11104",
 "body": "A *bold* comment through v2.",
 "jsdPublic": true
}

Sent to Atlassian Cloud on .

POST /rest/api/3/issue/{issueIdOrKey}/comment

Sends a plain string to v3. The request is refused and the problem is keyed by the field name comment.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "body": "plain string body"
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'body': 'plain string body'},
)
print(r.status_code, r.text)

Response: HTTP 400

{
 "errorMessages": [],
 "errors": {
  "comment": "Comment body is not valid!"
 }
}

Sent to Atlassian Cloud on .

GET /rest/api/3/issue/{issueIdOrKey}/comment

Lists the two comments, newest first, with a page of size 2.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'maxResults=2' \
  --data-urlencode 'orderBy=-created' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'maxResults': '2', 'orderBy': '-created'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "startAt": 0,
 "maxResults": 2,
 "total": 2,
 "comments": [
  {
   "id": "11104",
   "body": {
    "type": "doc",
    "version": 1,
    "content": [
     {
      "type": "paragraph",
      "content": [
       {
        "type": "text",
        "text": "A "
       },
       {
        "type": "text",
        "text": "bold",
        "marks": [
         {
          "type": "strong"
         }
        ]
       },
       {
        "type": "text",
        "text": " comment through v2."
       }
      ]
     }
    ]
   },
   "created": "2026-11-29T19:29:56.610+0200"
  },
  {
   "id": "11103",
   "body": {
    "type": "doc",
    "version": 1,
    "content": [
     {
      "type": "paragraph",
      "content": [
       {
        "type": "text",
        "text": "First comment through the REST API."
       }
      ]
     }
    ]
   },
   "created": "2026-11-29T19:29:55.626+0200"
  }
 ]
}

Response headers

X-Ratelimit-Limit: 350

Sent to Atlassian Cloud on .

GET /rest/api/2/issue/{issueIdOrKey}/comment/{commentId}

Reads one comment on v2 and asks for the HTML rendering with expand=renderedBody.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'expand=renderedBody' \
  'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/comment/{commentId}'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/comment/{commentId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'expand': 'renderedBody'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "id": "11103",
 "body": "First comment through the REST API.",
 "renderedBody": "<p>First comment through the REST API.</p>"
}

Sent to Atlassian Cloud on .

PUT /rest/api/3/issue/{issueIdOrKey}/comment/{commentId}

Replaces the body of the first comment. The id and created stay, updated moves.

curl

curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "body": {
    "type": "doc",
    "version": 1,
    "content": [
      {
        "type": "paragraph",
        "content": [
          {
            "type": "text",
            "text": "Edited comment."
          }
        ]
      }
    ]
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'body': {'type': 'doc',
                   'version': 1,
                   'content': [{'type': 'paragraph',
                                'content': [{'type': 'text', 'text': 'Edited comment.'}]}]}},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "id": "11103",
 "body": {
  "type": "doc",
  "version": 1,
  "content": [
   {
    "type": "paragraph",
    "content": [
     {
      "type": "text",
      "text": "Edited comment."
     }
    ]
   }
  ]
 },
 "created": "2026-11-29T19:29:55.626+0200",
 "updated": "2026-11-29T19:30:01.688+0200"
}

Sent to Atlassian Cloud on .

DELETE /rest/api/3/issue/{issueIdOrKey}/comment/{commentId}

Deletes the second comment. Success has no body.

curl

curl -X DELETE \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.delete(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)

Response: HTTP 204

No response body.

Sent to Atlassian Cloud on .

How it behaves

  • A comment created on v3 comes back with status 201, a Location header that points at the new /comment/{id}, and the body echoed as the ADF document that was sent.
  • Sending the body as a plain string to v3 gives 400 with errors.comment set to "Comment body is not valid!". The same string is accepted on /rest/api/2 and stored as wiki markup.
  • A comment created through v2 with *bold* reads back through v3 as an ADF paragraph with a strong mark on the word, so the two versions share one stored comment.
  • orderBy=-created returned the newer comment (11104) before the older one (11103). The OpenAPI spec lists only created as accepted for orderBy; the leading minus was accepted anyway.
  • After a DELETE answered 204, a GET on the same comment id answered 404 with the message "Can not find a comment for the id: 11104.".

Pitfalls

  • Wrap text in {"type": "doc", "version": 1, "content": [...]} on v3. A string body fails even though it looks harmless.
  • PUT replaces the body. Send the whole new document, not a diff.
  • jsdPublic is true on comments created through the platform API, and the spec says it defaults to true outside Jira Service Management requests.
  • The comment list is paged. Check total against the number of comments received instead of assuming one page holds them all.

Questions and answers

Why does my v3 comment return "Comment body is not valid!"?

The v3 body must be an Atlassian Document Format object. A plain string is only valid on /rest/api/2, where the body is wiki markup.

Can I read a comment as HTML?

Yes. Add expand=renderedBody and the response carries a renderedBody string next to the body, as the v2 read above shows.

Sources

  1. The Jira Cloud platform REST API v3 (Atlassian Developer)
  2. Add comment (Jira REST API v3)

Markdown version · All REST API pages