Home/Atlassian REST API reference
Jira and Confluence Cloud REST API
Send Atlassian Document Format in REST request bodies
Atlassian Document Format is a JSON tree with type doc, version 1 and a content array of block nodes. Jira v3 requires it for description, environment, comment bodies, worklog comments and multi-line text custom fields. Confluence v2 accepts it as a body representation, but there the document is sent as a JSON string inside the body value.
Endpoints
| Method | Path | What it does |
|---|---|---|
POST | /rest/api/3/issue | Accepts an ADF description. |
POST | /rest/api/3/issue/{issueIdOrKey}/comment | Accepts an ADF body. |
PUT | /wiki/api/v2/pages/{id} | Accepts body.representation atlas_doc_format with the document as a string. |
Examples
POST /rest/api/3/issue
Creates a work item whose description is a one paragraph ADF document.
curl
curl -X POST \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"project": {
"key": "WEB"
},
"issuetype": {
"name": "Task"
},
"summary": "Example created through REST API",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Created with POST /rest/api/3/issue."
}
]
}
]
},
"labels": [
"api-example"
],
"duedate": "2026-12-15"
}
}' \
'https://your-domain.atlassian.net/rest/api/3/issue'Python (requests)
import os
import requests
EMAIL = "you@example.com"
r = requests.post(
'https://your-domain.atlassian.net/rest/api/3/issue',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
json={'fields': {'project': {'key': 'WEB'},
'issuetype': {'name': 'Task'},
'summary': 'Example created through REST API',
'description': {'type': 'doc',
'version': 1,
'content': [{'type': 'paragraph',
'content': [{'type': 'text',
'text': 'Created with POST '
'/rest/api/3/issue.'}]}]},
'labels': ['api-example'],
'duedate': '2026-12-15'}},
)
print(r.status_code, r.text)Response: HTTP 201
{
"id": "10768",
"key": "WEB-57",
"self": "https://your-domain.atlassian.net/rest/api/3/issue/10768"
}Sent to Atlassian Cloud on .
POST /rest/api/3/issue
Shows the error when the description is a plain string.
curl
curl -X POST \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"project": {
"key": "WEB"
},
"issuetype": {
"name": "Task"
},
"summary": "Plain string description",
"description": "plain string"
}
}' \
'https://your-domain.atlassian.net/rest/api/3/issue'Python (requests)
import os
import requests
EMAIL = "you@example.com"
r = requests.post(
'https://your-domain.atlassian.net/rest/api/3/issue',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
json={'fields': {'project': {'key': 'WEB'},
'issuetype': {'name': 'Task'},
'summary': 'Plain string description',
'description': 'plain string'}},
)
print(r.status_code, r.text)Response: HTTP 400
{
"errorMessages": [],
"errors": {
"description": "The field value is not valid Atlassian Document Format (ADF) content."
}
}Sent to Atlassian Cloud on .
POST /rest/api/3/issue/{issueIdOrKey}/comment
Adds a comment with an ADF body and gets the same document back.
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"
}Sent to Atlassian Cloud on .
POST /rest/api/3/issue/{issueIdOrKey}/comment
Shows the error when the comment body is a plain string.
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 .
PUT /wiki/api/v2/pages/{pageId}
Updates a Confluence page with an ADF body, sent as a string in value.
curl
curl -X PUT \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"id": "{pageId}",
"status": "current",
"title": "Example page",
"version": {
"number": 3
},
"body": {
"representation": "atlas_doc_format",
"value": "{\"type\": \"doc\", \"version\": 1, \"content\": [{\"type\": \"paragraph\", \"content\": [{\"type\": \"text\", \"text\": \"Body written as ADF.\"}]}]}"
}
}' \
'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}'Python (requests)
import os
import requests
EMAIL = "you@example.com"
r = requests.put(
'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
json={'id': '{pageId}',
'status': 'current',
'title': 'Example page',
'version': {'number': 3},
'body': {'representation': 'atlas_doc_format',
'value': '{"type": "doc", "version": 1, "content": [{"type": "paragraph", '
'"content": [{"type": "text", "text": "Body written as ADF."}]}]}'}},
)
print(r.status_code, r.text)Response: HTTP 200
{
"version": {
"number": 3
},
"status": "current",
"body": {
"storage": {
"representation": "storage",
"value": "<p>Body written as ADF.</p>"
}
},
"title": "Example page",
"id": "33653083"
}Sent to Atlassian Cloud on .
How it behaves
- A v3 description or comment body of {"type": "doc", "version": 1, "content": [...]} is accepted, and the response echoes the same document.
- A plain string for description answers 400 with errors.description set to The field value is not valid Atlassian Document Format (ADF) content.
- A plain string for a comment body answers 400 with errors.comment set to Comment body is not valid!, a different message from the one on description.
- On Confluence v2 the value is the ADF document serialised to a string, and the response returns the body in the storage representation, not in the one that was sent.
Pitfalls
- Both successful runs wrap each text node in a paragraph node inside the doc node. Copy that shape and add nodes from there.
- The 400 message differs by field, so match on the key in errors (description or comment) rather than on the text.
- On a Confluence page the run sent value as a string. Serialise the document before putting it in the body.
- A custom single-line text field is not an ADF field. Only multi-line text fields take a document.
Questions and answers
What is the smallest valid ADF document?
An object with type doc, version 1 and a content array holding one paragraph node that contains a text node, as in the create work item example.
Can I send Markdown instead?
Not through these fields. v3 expects ADF and v2 expects wiki markup strings. The runs do not cover a Markdown body.