This is the reference for the Confluence Cloud REST API. This API is the primary way to get and modify data in Confluence Cloud, whether you are developing an app or any other integration. Use it to interact with Confluence entities, like pages and blog posts, spaces, users, groups, and more.
Authentication: If you are building a Cloud app, authentication is implemented via JWT (see Authentication for apps). Otherwise, if you are authenticating directly against the REST API, the REST API supports basic auth (see Basic auth for REST APIs).
Authorization: If you are building a Cloud app, authorization can be implemented by scopes or by OAuth 2.0 user impersonation. Otherwise, if you are making calls directly against the REST API, authorization is based on the user used in the authentication process.
See Security overview for more details on authentication and authorization.
The Confluence REST API uses the standard HTTP status codes.
Responses that return an error status code will also return a response body, similar to the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
{
"statusCode": 404,
"data": {
"authorized": false,
"valid": false,
"errors": [
{
"message": {
"translation": "This is an example error message.",
"args": []
}
}
],
"successful": false
},
"message": "This is an example error message."
}
Expansion: The Confluence REST API uses resource expansion: some parts of a resource are not returned unless explicitly specified. This simplifies responses and minimizes network traffic.
To expand part of a resource in a request, use the expand
query parameter and specify the entities to be expanded. If you need to expand nested entities, use the .
dot notation. For example, the following request will expand information about the requested content's space and labels:
1
GET /wiki/rest/api/content/{id}?expand=space,metadata.labels
Pagination: The Confluence REST API uses pagination: a method that returns a response with multiple objects can only return a limited number at one time. This limits the size of responses and conserves server resources.
Use the 'limit' and 'start' query parameters to specify pagination:
limit
is the number of objects to return per page. This may be restricted by system limits.start
is the index of the first item returned in the page of results. The base index is 0.For example, the following request will return ten content objects, starting from the fifth object.
1
GET /wiki/rest/api/content?start=4,limit=10
Special headers:
X-Atlassian-Token: no-check
request header must be specified for methods
that are protected from Cross Site Request Forgery (XSRF/CSRF) attacks. This is
stated in the method description, if required. For more information, see this
KB article.Webhooks: A webhook is a user-defined callback over HTTP. You can use Confluence webhooks to notify your app or web application when certain events occur in Confluence. For example, when a page is created or updated. To learn more, see Webhooks.
Content properties: Content properties are a key-value storage associated with a piece of Confluence content. If you are building an app, this is one form of persistence that you can use. You can use the Confluence REST API to get, update, and delete content properties. To learn more, see Content properties in the REST API.
CQL: The Confluence Query Language (CQL) allows you to perform complex searches for content using an SQL-like syntax in the search
resource. To learn more, see Advanced searching using CQL.
GET /wiki/rest/api/audit
Returns all records in the audit log, optionally for a certain date range. This contains information about events like space exports, group membership changes, app installations, etc. For more information, see Audit log in the Confluence administrator's guide.
Permissions required: 'Confluence Administrator' global permission.
Apps cannot access this REST resource.
string
Filters the results to the records on or after the startDate
.
The startDate
must be specified as a timestamp.
string
Filters the results to the records on or before the endDate
.
The endDate
must be specified as a timestamp.
string
Filters the results to records that have string property values
matching the searchString
.
integer
The starting index of the returned records.
0
, Minimum: 0
, Format: int32
integer
The maximum number of records to return per page. Note, this may be restricted by fixed system limits.
1000
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/audit' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested records are returned.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/audit
Creates a record in the audit log.
Permissions required: 'Confluence Administrator' global permission.
Apps cannot access this REST resource.
The user that actioned the event. If author
is not specified, then all
author
properties will be set to null/empty, except for type
which
will be set to 'user'.
string
The IP address of the computer where the event was initiated from.
integer
The creation date-time of the audit record, as a timestamp. This is converted
to a date-time display in the Confluence UI. If the creationDate
is not
specified, then it will be set to the timestamp for the current date-time.
int64
string
The summary of the event, which is displayed in the 'Change' column on the audit log in the Confluence UI.
string
A long description of the event, which is displayed in the 'Description' field on the audit log in the Confluence UI.
string
The category of the event, which is displayed in the 'Event type' column on the audit log in the Confluence UI.
boolean
Indicates whether the event was actioned by a system administrator.
false
Array<ChangedValue>
The values that were changed in the event.
Array<AffectedObject>
Objects that were associated with the event. For example, if the event was a space permission change then the associated object would be the space.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/audit' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"author": {
"type": "user",
"displayName": "<string>",
"operations": {},
"username": "<string>",
"userKey": "<string>"
},
"remoteAddress": "<string>",
"creationDate": 228,
"summary": "<string>",
"description": "<string>",
"category": "<string>",
"sysAdmin": true,
"affectedObject": {
"name": "<string>",
"objectType": "<string>"
},
"changedValues": [
{
"name": "<string>",
"oldValue": "<string>",
"newValue": "<string>"
}
],
"associatedObjects": [
{
"name": "<string>",
"objectType": "<string>"
}
]
}'
Returned if the record is created in the audit log.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/audit/export
Exports audit records as a CSV file or ZIP file.
Permissions required: 'Confluence Administrator' global permission.
Apps cannot access this REST resource.
string
Filters the exported results to the records on or after the startDate
.
The startDate
must be specified as a timestamp.
string
Filters the exported results to the records on or before the endDate
.
The endDate
must be specified as a timestamp.
string
Filters the exported results to records that have string property values
matching the searchString
.
string
The format of the export file for the audit records.
csv
Valid values: csv
, zip
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/audit/export' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/zip'
Returned if the requested export of the audit records is returned.
Content type | Value |
---|---|
application/zip | string |
text/csv | string |
GET /wiki/rest/api/audit/retention
Returns the retention period for records in the audit log. The retention period is how long an audit record is kept for, from creation date until it is deleted.
Permissions required: 'Confluence Administrator' global permission.
Apps cannot access this REST resource.
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/audit/retention' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested retention period is returned.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/audit/retention
Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.
Permissions required: 'Confluence Administrator' global permission.
Apps cannot access this REST resource.
integer
The number of units for the retention period.
int32
string
The unit of time that the retention period is measured in.
Valid values: NANOS
, MICROS
, MILLIS
, SECONDS
, MINUTES
, HOURS
, HALF_DAYS
, DAYS
, WEEKS
, MONTHS
...(Show more)
1 2 3 4 5 6 7 8 9
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/audit/retention' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"number": 45,
"units": "NANOS"
}'
Returned if the retention period is updated.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/audit/since
Returns records from the audit log, for a time period back from the current date. For example, you can use this method to get the last 3 months of records.
This contains information about events like space exports, group membership changes, app installations, etc. For more information, see Audit log in the Confluence administrator's guide.
Permissions required: 'Confluence Administrator' global permission.
Apps cannot access this REST resource.
integer
The number of units for the time period.
3
, Format: int64
string
The unit of time that the time period is measured in.
MONTHS
Valid values: NANOS
, MICROS
, MILLIS
, SECONDS
, MINUTES
, HOURS
, HALF_DAYS
, DAYS
, WEEKS
, MONTHS
...(Show more)
string
Filters the results to records that have string property values
matching the searchString
.
integer
The starting index of the returned records.
0
, Minimum: 0
, Format: int32
integer
The maximum number of records to return per page. Note, this may be restricted by fixed system limits.
1000
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/audit/since' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested records are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content
Returns all content in a Confluence instance.
Permissions required: Permission to access the Confluence site ('Can use' global permission). Only content that the user has permission to view will be returned.
App scope required: READ
string
The type of content to return.
page
Valid values: page
, blogpost
string
The key of the space to be queried for its content.
string
The title of the page to be returned. Required for page type.
Array<string>
Filter the results to a set of content based on their status. If set to any
,
content with any status is returned. Note, the historical
status is currently
not supported.
current
string
The posting date of the blog post to be returned. Required for blogpost type. Format: yyyy-mm-dd.
Array<string>
A multi-value parameter indicating which properties of the content to expand.
By default, the following objects are expanded: space
, history
, version
.
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
string
If set to viewed
, the request will trigger a 'viewed' event for the content.
When this event is triggered, the page/blogpost will appear on the 'Recently visited'
tab of the user's Confluence dashboard.
Valid values: viewed
string
Orders the content by a particular field. Specify the field and sort direction for this parameter, as follows: 'fieldpath asc/desc'. For example, 'history.createdDate desc'.
integer
The starting index of the returned content.
0
, Minimum: 0
, Format: int32
integer
The maximum number of content objects to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested list of content is returned.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content
Creates a new piece of content or publishes an existing draft.
To publish a draft, add the id
and status
properties to the body of the request.
Set the id
to the ID of the draft and set the status
to 'current'. When the
request is sent, a new piece of content will be created and the metadata from the
draft will be transferred into it.
Permissions required: 'Add' permission for the space that the content will be created in, and permission to view the draft if publishing a draft.
App scope required: WRITE
string
Filter the returned content by status.
current
Array<string>
A multi-value parameter indicating which properties of the new content to expand.
By default, the following objects are expanded: space
, history
, version
.
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
string
The ID of the draft content. Required when publishing a draft.
string
255
string
The type of the new content. Custom content types defined by apps are also supported.
Valid values: page
, blogpost
, comment
, attachment
The space that the content is being created in.
string
The status of the new content.
current
Valid values: current
, trashed
, historical
, draft
Array<object>
The parent content of the new content. Only one parent content
id
can be specified.
The body of the new content. Does not apply to attachments.
Only one body format should be specified as the property for
this object, e.g. storage
.
Note, editor2
format is used by Atlassian only. anonymous_export_view
is
the same as 'export_view' format but only content viewable by an anonymous
user is included.
1
, Max properties: 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"id": "<string>",
"title": "<string>",
"type": "page",
"space": {
"key": "<string>"
},
"status": "current",
"ancestors": [
{
"id": "<string>"
}
],
"body": {
"view": {
"value": "<string>",
"representation": "view"
},
"export_view": {
"value": "<string>",
"representation": "view"
},
"styled_view": {
"value": "<string>",
"representation": "view"
},
"storage": {
"value": "<string>",
"representation": "view"
},
"editor2": {
"value": "<string>",
"representation": "view"
},
"anonymous_export_view": {
"value": "<string>",
"representation": "view"
}
}
}'
Returned if the content is created.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/content/blueprint/instance/{draftId}
Publishes a shared draft of a page created from a blueprint.
Permissions required: Permission to view the draft and 'Add' permission for the space that the content will be created in.
App scope required: WRITE
string
The ID of the draft page that was created from a blueprint.
You can find the draftId
in the Confluence application by
opening the draft page and checking the page URL.
string
The status of the content to be updated, i.e. the draft. This is set to 'draft' by default, so you shouldn't need to specify it.
draft
Array<string>
A multi-value parameter indicating which properties of the new content
to expand when returned. By default, the following objects are expanded:
body.storage
,history
,space
,version
,ancestors
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
The version for the new content.
string
The title of the content. If you don't want to change the title, set this to the current title of the draft.
255
string
The type of content. Set this to page
.
Valid values: page
string
The status of the content. Set this to current
or omit it altogether.
current
Valid values: current
The space for the content.
Array<object>
The new ancestor (i.e. parent page) for the content. If you have
specified an ancestor, you must also specify a space
property
in the request body for the space that the ancestor is in.
Note, if you specify more than one ancestor, the last ID in the array will be selected as the parent page for the content.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/blueprint/instance/{draftId}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": {
"number": 36
},
"title": "<string>",
"type": "page",
"status": "current",
"space": {
"key": "<string>"
},
"ancestors": [
{
"id": "<string>"
}
]
}'
Returned if the draft was successfully published.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/blueprint/instance/{draftId}
Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of shared drafts. For now, this method works the same as Publish shared draft.
Permissions required: Permission to view the draft and 'Add' permission for the space that the content will be created in.
App scope required: WRITE
string
The ID of the draft page that was created from a blueprint.
You can find the draftId
in the Confluence application by
opening the draft page and checking the page URL.
string
The status of the content to be updated, i.e. the draft. This is set to 'draft' by default, so you shouldn't need to specify it.
draft
Array<string>
A multi-value parameter indicating which properties of the new content
to expand when returned. By default, the following objects are expanded:
body.storage
,history
,space
,version
,ancestors
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
The version for the new content.
string
The title of the content. If you don't want to change the title, set this to the current title of the draft.
255
string
The type of content. Set this to page
.
Valid values: page
string
The status of the content. Set this to current
or omit it altogether.
current
Valid values: current
The space for the content.
Array<object>
The new ancestor (i.e. parent page) for the content. If you have
specified an ancestor, you must also specify a space
property
in the request body for the space that the ancestor is in.
Note, if you specify more than one ancestor, the last ID in the array will be selected as the parent page for the content.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/blueprint/instance/{draftId}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": {
"number": 36
},
"title": "<string>",
"type": "page",
"status": "current",
"space": {
"key": "<string>"
},
"ancestors": [
{
"id": "<string>"
}
]
}'
Returned if the draft was successfully published.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/search
Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see: Advanced searching using CQL.
Permissions required: Permission to access the Confluence site ('Can use' global permission). Only content that the user has permission to view will be returned.
App scope required: READ
string
The CQL string that is used to find the requested content.
string
The space, content, and content status to execute the search against. Specify this as an object with the following properties:
spaceKey
Key of the space to search against. Optional.contentId
ID of the content to search against. Optional. Must
be in the space spacified by spaceKey
.contentStatuses
Content statuses to search against. Optional.Array<string>
A multi-value parameter indicating which properties of the content to expand.
childTypes.all
returns whether the content has attachments, comments,
or child pages. Use this if you only need to check whether the content
has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same
as the information returned by Get space.metadata.currentuser
returns information about the current user in
relation to the content, like when they last viewed it, modified it,
contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set
via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used
when setting permissions.children.page
returns pages that are descendants at the level
immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have
permission to read the content.restrictions.read.restrictions.group
returns the groups that have
permission to read the content.restrictions.update.restrictions.user
returns the users that have
permission to update the content.restrictions.update.restrictions.group
returns the groups that have
permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update
of the content, including who updated it and when it was updated.history.previousVersion
returns information about the update prior to
the current content update.history.contributors
returns all of the users who have contributed to
the content.history.nextVersion
returns information about the update after to the
current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the
editor format, view format, and export format.version
returns information about the most recent update of the content,
including who updated it and when it was updated.descendants.page
returns pages that are descendants at any level below the
content.descendants.attachment
returns all attachments for the content, same as
children.attachment
.descendants.comment
returns all comments on the content, same as
children.comment
.space
returns the space that the content is in. This is the same as the
information returned by Get space.form
integer
The starting index of the returned content.
0
, Minimum: 0
, Format: int32
integer
The maximum number of content objects to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/search' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested list of content is returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}
Returns a single piece of content, like a page or a blog post.
Permissions required: Permission to view the content. If the content is a blog post, 'View' permission for the space is required.
App scope required: READ
string
The ID of the content to be returned. If you don't know the content ID, use Get content and filter the results.
Array<string>
Filter the results to a set of content based on their status.
If set to any
, content with any status is returned. Note, the
historical
status is currently not supported.
current
integer
The version number of the content to be returned.
int32
string
The version of embedded content (e.g. attachments) to render.
current
Valid values: current
, version-at-save
Array<string>
A multi-value parameter indicating which properties of the content to expand.
By default, the following objects are expanded: space
, history
, version
.
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format, view format,
and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
string
If set to viewed
, the request will trigger a 'viewed' event for the content.
When this event is triggered, the page/blogpost will appear on the 'Recently visited'
tab of the user's Confluence dashboard.
Valid values: viewed
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested content is returned.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/content/{id}
Updates a piece of content. Use this method to update the title or body of a piece of content, change the status, change the parent page, and more.
Note, updating draft content is currently not supported.
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content to be updated.
string
The updated status of the content. Use this parameter to change the status of a piece of content without passing the entire request body.
current
Valid values: current
, trashed
, historical
, draft
string
The action that should be taken when conflicts are discovered. Only used when publishing a draft page.
abort
Valid values: abort
The new version for the updated content. Set this to the current version number incremented by one, unless you are changing the status to 'draft' which must have a version number of 1.
To get the current version number, use Get content by ID and retrieve version.number
.
string
The updated title of the content. If you are not changing this field, set this to the current title
.
255
string
The type of content. Set this to the current type of the content.
Valid values: page
, blogpost
, comment
, attachment
string
The updated status of the content. Note, if you change the status of a page from 'current' to 'draft' and it has an existing draft, the existing draft will be deleted in favor of the updated page.
Valid values: current
, trashed
, historical
, draft
Array<object>
The new parent for the content. Only one parent content 'id' can be specified.
The updated body of the content. Does not apply to attachments.
If you are not sure how to generate these formats, you can create a page in the
Confluence application, retrieve the content using Get content,
and expand the desired content format, e.g. expand=body.storage
.
1
, Max properties: 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": {
"number": 19
},
"title": "<string>",
"type": "page",
"status": "current",
"ancestors": [
{
"id": "<string>"
}
],
"body": {
"view": {
"value": "<string>",
"representation": "view"
},
"export_view": {
"value": "<string>",
"representation": "view"
},
"styled_view": {
"value": "<string>",
"representation": "view"
},
"storage": {
"value": "<string>",
"representation": "view"
},
"editor2": {
"value": "<string>",
"representation": "view"
},
"anonymous_export_view": {
"value": "<string>",
"representation": "view"
}
}
}'
Returned if the content is updated.
Content type | Value |
---|---|
application/json |
DELETE /wiki/rest/api/content/{id}
Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and status:
page
or blogpost
and its status is current
,
it will be trashed.page
or blogpost
and its status is trashed
,
the content will be purged from the trash and deleted permanently. Note,
you must also set the status
query parameter to trashed
in your request.comment
or attachment
, it will be deleted
permanently without being trashed.Permissions required: 'Delete' permission for the space that the content is in, and permission to edit the content.
App scope required: DELETE
string
The ID of the content to be deleted.
string
Set this to trashed
, if the content's status is trashed
and you want to purge it.
1 2 3
curl --request DELETE \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}' \
--user 'email@example.com:<api_token>'
Returned if the content is successfully trashed.
A schema has not been defined for this response code.
GET /wiki/rest/api/content/{id}/child
Returns a map of the direct children of a piece of content. A piece of content has different types of child content, depending on its type. These are the default parent-child content type relationships:
page
: child content is page
, comment
, attachment
blogpost
: child content is comment
, attachment
attachment
: child content is comment
comment
: child content is attachment
Apps can override these default relationships. Apps can also introduce new content types that create new parent-child content relationships.
Note, the map will always include all child content types that are valid for the content. However, if the content has no instances of a child content type, the map will contain an empty array for that child content type.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for its children.
Array<string>
A multi-value parameter indicating which properties of the children to expand, where:
attachment
returns all attachments for the content.comments
returns all comments for the content.page
returns all child pages of the content.form
integer
The version of the parent content to retrieve children for. Currently, this only works for the latest version.
0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested content children are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/child/attachment
Returns the attachments for a piece of content.
Permissions required: Permission to view the content. If the content is a blog post, 'View' permission for the space is required.
App scope required: READ
string
The ID of the content to be queried for its attachments.
Array<string>
A multi-value parameter indicating which properties of the
attachments to expand. By default, the following objects are expanded:
metadata
.
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
integer
The starting index of the returned attachments.
0
, Minimum: 0
, Format: int32
integer
The maximum number of attachments to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
string
Filter the results to attachments that match the filename.
string
Filter the results to attachments that match the media type.
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/attachment' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested attachments are returned.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/content/{id}/child/attachment
Adds an attachment to a piece of content. If the attachment already exists for the content, then the attachment is updated (i.e. a new version of the attachment is created).
Note, you must set a X-Atlassian-Token: nocheck
header on the request
for this method, otherwise it will be blocked. This protects against XSRF
attacks, which is necessary as this method accepts multipart/form-data.
The media type 'multipart/form-data' is defined in RFC 1867. Most client libraries have classes that make it easier to implement multipart posts, like the MultiPartEntity Java class provided by Apache HTTP Components.
Example: This curl command attaches a file ('example.txt') to a piece of
content (id='123') with a comment and minorEdits
=true. If the 'example.txt'
file already exists, it will update it with a new version of the attachment.
1 2 3 4 5 6 7 8
curl -D- \
-u admin:admin \
-X PUT \
-H "X-Atlassian-Token: nocheck" \
-F "file=@example.txt" \
-F "minorEdit=true" \
-F "comment=Example attachment comment" \
http://myhost/rest/api/content/123/child/attachment
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content to add the attachment to.
string
The status of the content that the attachment is being added to. This should always be set to 'current'.
current
Valid values: current
, draft
Content type | Value |
---|---|
multipart/form-data |
1 2 3 4
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/attachment' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the attachments were added to the content.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/child/attachment
Adds an attachment to a piece of content. This method only adds a new attachment. If you want to update an existing attachment, use Create or update attachments.
Note, you must set a X-Atlassian-Token: nocheck
header on the request
for this method, otherwise it will be blocked. This protects against XSRF
attacks, which is necessary as this method accepts multipart/form-data.
The media type 'multipart/form-data' is defined in RFC 1867. Most client libraries have classes that make it easier to implement multipart posts, like the MultiPartEntity Java class provided by Apache HTTP Components.
Example: This curl command attaches a file ('example.txt') to a container
(id='123') with a comment and minorEdits
=true.
1 2 3 4 5 6 7 8
curl -D- \
-u admin:admin \
-X POST \
-H "X-Atlassian-Token: nocheck" \
-F "file=@example.txt" \
-F "minorEdit=true" \
-F "comment=Example attachment comment" \
http://myhost/rest/api/content/123/child/attachment
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content to add the attachment to.
string
The status of the content that the attachment is being added to.
current
Valid values: current
, draft
Content type | Value |
---|---|
multipart/form-data |
1 2 3 4
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/attachment' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the attachments were added to the content.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/content/{id}/child/attachment/{attachmentId}
Updates the attachment properties, i.e. the non-binary data of an attachment like the filename, media-type, comment, and parent container.
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content that the attachment is attached to.
string
The ID of the attachment to update.
The attachment version. Set this to the current version number of the attachment. Note, the version number only needs to be incremented when updating the actual attachment, not its properties.
string
The ID of the attachment to be updated.
string
Set this to attachment
.
Valid values: attachment
string
The updated name of the attachment.
255
The new content to attach the attachment to.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/attachment/{attachmentId}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": {
"number": 19
},
"id": "<string>",
"type": "attachment",
"title": "<string>",
"metadata": {
"mediaType": "<string>",
"comment": "<string>"
},
"container": {
"id": "<string>",
"type": "<string>"
}
}'
Returned if the attachment is updated.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/child/attachment/{attachmentId}/data
Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit field.
This method is essentially the same as Create or update attachments, except that it matches the attachment ID rather than the name.
Note, you must set a X-Atlassian-Token: nocheck
header on the request
for this method, otherwise it will be blocked. This protects against XSRF
attacks, which is necessary as this method accepts multipart/form-data.
The media type 'multipart/form-data' is defined in RFC 1867. Most client libraries have classes that make it easier to implement multipart posts, like the MultiPartEntity Java class provided by Apache HTTP Components.
Example: This curl command updates an attachment (id='att456') that is attached
to a piece of content (id='123') with a comment and minorEdits
=true.
1 2 3 4 5 6 7 8
curl -D- \
-u admin:admin \
-X POST \
-H "X-Atlassian-Token: nocheck" \
-F "file=@example.txt" \
-F "minorEdit=true" \
-F "comment=Example attachment comment" \
http://myhost/rest/api/content/123/child/attachment/att456/data
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content that the attachment is attached to.
string
The ID of the attachment to update.
Content type | Value |
---|---|
multipart/form-data |
1 2 3 4
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/attachment/{attachmentId}/data' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the attachment is updated.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/child/comment
Returns the comments on a piece of content.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for its comments.
Array<string>
A multi-value parameter indicating which properties of the attachments to expand.
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.In addition, the following comment-specific expansions can be used:
extensions.inlineProperties
returns inline comment-specific properties.extensions.resolution
returns the resolution status of each comment.form
integer
The version of the parent content to retrieve children for. Currently, this only works for the latest version.
0
, Minimum: 0
, Format: int32
integer
The starting index of the returned comments.
int32
integer
The maximum number of comments to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
Array<string>
The location of the comments in the page. Multiple locations can be specified. If no location is specified, comments from all locations are returned.
string
Currently, this parameter is not used. Comments are returned at the root level only.
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/comment' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested comments are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/child/{type}
Returns all children of a given type, for a piece of content. A piece of content has different types of child content, depending on its type:
page
: child content is page
, comment
, attachment
blogpost
: child content is comment
, attachment
attachment
: child content is comment
comment
: child content is attachment
Custom content types that are provided by apps can also be returned.
Note, this method only returns direct children. To return children at all levels, use Get descendants by type.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for its children.
string
The type of children to return.
Valid values: page
, comment
, attachment
Array<string>
A multi-value parameter indicating which properties of the new content to expand.
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
integer
The version of the parent content to retrieve children for. Currently, this only works for the latest version.
0
, Minimum: 0
, Format: int32
integer
The starting index of the returned content.
int32
integer
The maximum number of content to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/{type}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested content is returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/descendant
Returns a map of the descendants of a piece of content. This is similar to Get content children, except that this method returns child pages at all levels, rather than just the direct child pages.
A piece of content has different types of descendants, depending on its type:
page
: descendant is page
, comment
, attachment
blogpost
: descendant is comment
, attachment
attachment
: descendant is comment
comment
: descendant is attachment
The map will always include all descendant types that are valid for the content. However, if the content has no instances of a descendant type, the map will contain an empty array for that descendant type.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for its descendants.
Array<string>
A multi-value parameter indicating which properties of the children to expand, where:
attachment
returns all attachments for the content.comments
returns all comments for the content.page
returns all child pages of the content.form
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/descendant' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested descendants are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/descendant/{type}
Returns all descendants of a given type, for a piece of content. This is similar to Get content children by type, except that this method returns child pages at all levels, rather than just the direct child pages.
A piece of content has different types of descendants, depending on its type:
page
: descendant is page
, comment
, attachment
blogpost
: descendant is comment
, attachment
attachment
: descendant is comment
comment
: descendant is attachment
Custom content types that are provided by apps can also be returned.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for its descendants.
string
The type of descendants to return.
Valid values: page
, comment
, attachment
Array<string>
A multi-value parameter indicating which properties of the new content to expand.
childTypes.all
returns whether the content has attachments, comments, or child pages.
Use this if you only need to check whether the content has children of a particular type.childTypes.attachment
returns whether the content has attachments.childTypes.comment
returns whether the content has comments.childTypes.page
returns whether the content has child pages.container
returns the space that the content is in. This is the same as the information
returned by Get space.metadata.currentuser
returns information about the current user in relation to the content,
like when they last viewed it, modified it, contributed to it, or added it as a favourite.metadata.properties
returns content properties that have been set via the Confluence REST API.metadata.labels
returns the labels that have been added to the content.metadata.frontend
(this property is only used by Atlassian)operations
returns the operations for the content, which are used when setting permissions.children.page
returns pages that are descendants at the level immediately below the content.children.attachment
returns all attachments for the content.children.comment
returns all comments on the content.restrictions.read.restrictions.user
returns the users that have permission to read the content.restrictions.read.restrictions.group
returns the groups that have permission to read the content.restrictions.update.restrictions.user
returns the users that have permission to update the content.restrictions.update.restrictions.group
returns the groups that have permission to update the content.history
returns the history of the content, including the date it was created.history.lastUpdated
returns information about the most recent update of the content, including
who updated it and when it was updated.history.previousVersion
returns information about the update prior to the current content update.history.contributors
returns all of the users who have contributed to the content.history.nextVersion
returns information about the update after to the current content update.ancestors
returns the parent page, if the content is a page.body
returns the body of the content in different formats, including the editor format,
view format, and export format.version
returns information about the most recent update of the content, including who updated it
and when it was updated.descendants.page
returns pages that are descendants at any level below the content.descendants.attachment
returns all attachments for the content, same as children.attachment
.descendants.comment
returns all comments on the content, same as children.comment
.space
returns the space that the content is in. This is the same as the information returned by
Get space.form
integer
The starting index of the returned content.
0
, Minimum: 0
, Format: int32
integer
The maximum number of content to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/descendant/{type}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested content is returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/history
Returns the most recent update for a piece of content.
Permissions required: Permission to view the content.
App scope required: READ
string
The ID of the content to be queried for its history.
Array<string>
A multi-value parameter indicating which properties of the content history to expand.
lastUpdated
returns information about the most recent update of the content,
including who updated it and when it was updated.previousVersion
returns information about the update prior to the current content
update. For this method, it contains the same information as lastUpdated
.contributors
returns all of the users who have contributed to the content.nextVersion
This parameter is not used for this method.form
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/history' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested content history is returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/history/{version}/macro/id/{macroId}
Returns the body of a macro in storage format, for the given macro ID. This includes information like the name of the macro, the body of the macro, and any macro parameters. This method is mainly used by Cloud apps.
About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for it, unless an ID is specified (by an app). The macro ID will look similar to this: '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is only modified by Confluence if there are conflicting IDs.
Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and transparently propagate out to all instances.
Permissions required: Permission to view the content that the macro is in.
App scope required: READ
string
The ID for the content that contains the macro.
integer
The version of the content that contains the macro.
int32
string
The ID of the macro. This is usually passed by the app that the macro is in. Otherwise, find the macro ID by querying the desired content and version, then expanding the body in storage format. For example, '/content/196611/version/7?expand=content.body.storage'.
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/history/{version}/macro/id/{macroId}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested macro body is returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/label
Returns the labels on a piece of content.
Permissions required: 'View' permission for the space and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for its labels.
string
Filters the results to labels with the specified prefix. If this parameter
is not specified, then labels with any prefix will be returned.
global
prefix is used by default when a user adds a label
via the UI.my
prefix can be explicitly added by a user when adding a label
via the UI, e.g. 'my:example-label'. Also, when a page is selected as
a favourite, the 'my:favourite' label is automatically added.team
can used when adding labels via Add labels to content
but is not used in the UI. Valid values: global
, my
, team
integer
The starting index of the returned labels.
0
, Minimum: 0
, Format: int32
integer
The maximum number of labels to return per page. Note, this may be restricted by fixed system limits.
200
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/label' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested labels are returned.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/label
Adds labels to a piece of content. Does not modify the existing labels.
Notes:
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content that will have labels added to it.
Content type | Value |
---|---|
application/json | Array<LabelCreate> |
1 2 3 4 5 6 7 8 9 10 11
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/label' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '[
{
"prefix": "global",
"name": "<string>"
}
]'
Returned if the labels are added to the content.
Content type | Value |
---|---|
application/json |
DELETE /wiki/rest/api/content/{id}/label
Removes a label from a piece of content. This is similar to Remove label from content except that the label name is specified via a query parameter.
Use this method if the label name has "/" characters, as Remove label from content using query parameter does not accept "/" characters for the label name.
Permissions required: Permission to update the content.
App scope required: DELETE
string
The ID of the content that the label will be removed from.
string
The name of the label to be removed.
1 2 3
curl --request DELETE \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/label' \
--user 'email@example.com:<api_token>'
Returned if the label is removed. The response body will be empty.
DELETE /wiki/rest/api/content/{id}/label/{label}
Removes a label from a piece of content. This is similar to Remove label from content using query parameter except that the label name is specified via a path parameter.
Use this method if the label name does not have "/" characters, as the path parameter does not accept "/" characters for security reasons. Otherwise, use Remove label from content using query parameter.
Permissions required: Permission to update the content.
App scope required: DELETE
string
The ID of the content that the label will be removed from.
string
The name of the label to be removed.
1 2 3
curl --request DELETE \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/label/{label}' \
--user 'email@example.com:<api_token>'
Returned if the label is removed. The response body will be empty.
GET /wiki/rest/api/content/{id}/notification/child-created
Returns the watches for a page. A user that watches a page will receive receive notifications when the page is updated.
If you want to manage watches for a page, use the following user
methods:
Permissions required: Permission to access the Confluence site ('Can use' global permission).
App scope required: READ
string
The ID of the content to be queried for its watches.
integer
The starting index of the returned watches.
0
, Minimum: 0
, Format: int32
integer
The maximum number of watches to return per page. Note, this may be restricted by fixed system limits.
200
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/notification/child-created' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested watches are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/notification/created
Returns all space watches for the space that the content is in. A user that watches a space will receive receive notifications when any content in the space is updated.
If you want to manage watches for a space, use the following user
methods:
Permissions required: Permission to access the Confluence site ('Can use' global permission).
App scope required: READ
string
The ID of the content to be queried for its watches.
integer
The starting index of the returned watches.
0
, Minimum: 0
, Format: int32
integer
The maximum number of watches to return per page. Note, this may be restricted by fixed system limits.
200
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/notification/created' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested watches are returned.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/pagehierarchy/copy
Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the copied page titles.
Response example:
Use the /longtask/ REST API to get the copy task status.
App scope required: WRITE
string
boolean
boolean
boolean
boolean
string
string
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/pagehierarchy/copy' \
--user 'email@example.com:<api_token>' \
--header 'Content-Type: application/json' \
--data '{
"copyAttachments": true,
"copyPermissions": true,
"copyProperties": true,
"copyLabels": true,
"originalPageId": "<string>",
"destinationPageId": "<string>",
"titleOptions": {
"prefix": "<string>",
"replace": "<string>",
"search": "<string>"
}
}'
Returns a full JSON representation of a long running task
A schema has not been defined for this response code.
GET /wiki/rest/api/content/{id}/property
Returns the properties for a piece of content. For more information about content properties, see Content properties in the REST API.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for its properties.
Array<string>
A multi-value parameter indicating which properties of the content to
expand. By default, the version
object is expanded.
content
returns the content that the property is stored against.version
returns information about the version of the property, such
as the version number, when it was created, etc.form
integer
The starting index of the returned properties.
0
, Minimum: 0
, Format: int32
integer
The maximum number of properties to return per page. Note, this may be restricted by fixed system limits.
10
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/property' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested properties are returned.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/property
Creates a property for an existing piece of content. For more information about content properties, see Content properties in the REST API.
This is the same as Create content property for key except that the key is specified in the request body instead of as a path parameter.
Content properties can also be added when creating a new piece of content
by including them in the metadata.properties
of the request.
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content to add the property to.
string
The key of the new property.
255
The value of the property. This can be empty or a complex object. For example,
1 2 3 4 5
"value": {
"example1": "value",
"example2": true,
"example3": 123
}
1 2 3 4 5 6 7 8 9
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/property' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"key": "<string>",
"value": {}
}'
Returned if the content property is created.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/property/{key}
Returns a content property for a piece of content. For more information, see Content properties in the REST API.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
App scope required: READ
string
The ID of the content to be queried for the property.
string
The key of the content property.
Array<string>
A multi-value parameter indicating which properties of the content to
expand. By default, the version
object is expanded.
content
returns the content that the property is stored against.version
returns information about the version of the property, such
as the version number, when it was created, etc.form
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/property/{key}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the content property is returned.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/content/{id}/property/{key}
Updates an existing content property. This method will also create a new property for a piece of content, if the property key does not exist and the property version is 1. For more information about content properties, see Content properties in the REST API.
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content that the property belongs to.
string
The key of the property.
1 2 3 4 5 6 7 8 9 10 11 12
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/property/{key}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"value": {},
"version": {
"number": 201,
"minorEdit": true
}
}'
Returned if the content property is created.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/property/{key}
Creates a property for an existing piece of content. For more information about content properties, see Content properties in the REST API.
This is the same as Create content property except that the key is specified as a path parameter instead of in the request body.
Content properties can also be added when creating a new piece of content
by including them in the metadata.properties
of the request.
Permissions required: Permission to update the content.
App scope required: WRITE
string
The ID of the content to add the property to.
string
The key of the content property. Required.
The value of the property. This can be empty or a complex object. For example,
1 2 3 4 5
"value": {
"example1": "value",
"example2": true,
"example3": 123
}
1 2 3 4 5 6 7 8
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/property/{key}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"value": {}
}'
Returned if the content property is created.
Content type | Value |
---|---|
application/json |
DELETE /wiki/rest/api/content/{id}/property/{key}
Deletes a content property. For more information about content properties, see Content properties in the REST API.
Permissions required: Permission to update the content.
App scope required: DELETE
string
The ID of the content that the property belongs to.
string
The key of the property.
1 2 3
curl --request DELETE \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/property/{key}' \
--user 'email@example.com:<api_token>'
Returned if the content property is deleted.
GET /wiki/rest/api/content/{id}/restriction
Returns the restrictions on a piece of content.
Permissions required: Permission to view the content.
App scope required: READ
string
The ID of the content to be queried for its restrictions.
Array<string>
A multi-value parameter indicating which properties of the content
restrictions to expand. By default, the following objects are expanded:
restrictions.user
, restrictions.group
.
restrictions.user
returns the piece of content that the restrictions are
applied to.restrictions.group
returns the piece of content that the restrictions are
applied to.content
returns the piece of content that the restrictions are
applied to.form
integer
The starting index of the users and groups in the returned restrictions.
0
, Minimum: 0
, Format: int32
integer
The maximum number of users and the maximum number of groups, in the returned restrictions, to return per page. Note, this may be restricted by fixed system limits.
100
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested restrictions are returned.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/content/{id}/restriction
Updates restrictions for a piece of content. This removes the existing restrictions and replaces them with the restrictions in the request.
Permissions required: Permission to edit the content.
App scope required: WRITE
string
The ID of the content to update restrictions for.
Array<string>
A multi-value parameter indicating which properties of the content restrictions (returned in response) to expand.
restrictions.user
returns the piece of content that the restrictions are
applied to. Expanded by default.restrictions.group
returns the piece of content that the restrictions are
applied to. Expanded by default.content
returns the piece of content that the restrictions are
applied to. form
Content type | Value |
---|---|
application/json | Array<ContentRestrictionUpdate> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '[
{
"operation": "administer",
"restrictions": {
"user": [
{
"type": "known",
"username": "<string>",
"userKey": "<string>",
"accountId": "<string>"
}
],
"group": [
{
"type": "group",
"name": "<string>"
}
]
}
}
]'
Returned if the requested restrictions are updated.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/restriction
Adds restrictions to a piece of content. Note, this does not change any existing restrictions on the content.
Permissions required: Permission to edit the content.
App scope required: WRITE
string
The ID of the content to add restrictions to.
Array<string>
A multi-value parameter indicating which properties of the content restrictions (returned in response) to expand.
restrictions.user
returns the piece of content that the restrictions are
applied to. Expanded by default.restrictions.group
returns the piece of content that the restrictions are
applied to. Expanded by default.content
returns the piece of content that the restrictions are
applied to. form
Content type | Value |
---|---|
application/json | Array<ContentRestrictionUpdate> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '[
{
"operation": "administer",
"restrictions": {
"user": [
{
"type": "known",
"username": "<string>",
"userKey": "<string>",
"accountId": "<string>"
}
],
"group": [
{
"type": "group",
"name": "<string>"
}
]
}
}
]'
Returned if the requested restrictions are added.
Content type | Value |
---|---|
application/json |
DELETE /wiki/rest/api/content/{id}/restriction
Removes all restrictions (read and update) on a piece of content.
Permissions required: Permission to edit the content.
App scope required: DELETE
string
The ID of the content to remove restrictions from.
Array<string>
A multi-value parameter indicating which properties of the content restrictions (returned in response) to expand.
restrictions.user
returns the piece of content that the restrictions are
applied to. Expanded by default.restrictions.group
returns the piece of content that the restrictions are
applied to. Expanded by default.content
returns the piece of content that the restrictions are
applied to. form
1 2 3 4
curl --request DELETE \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the restrictions are removed.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/restriction/byOperation
Returns restrictions on a piece of content by operation. This method is similar to Get restrictions except that the operations are properties of the return object, rather than items in a results array.
Permissions required: Permission to view the content.
App scope required: READ
string
The ID of the content to be queried for its restrictions.
Array<string>
A multi-value parameter indicating which properties of the content restrictions to expand.
restrictions.user
returns the piece of content that the restrictions are
applied to. Expanded by default.restrictions.group
returns the piece of content that the restrictions are
applied to. Expanded by default.content
returns the piece of content that the restrictions are
applied to. form
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested restrictions are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}
Returns the restictions on a piece of content for a given operation (read or update).
Permissions required: Permission to view the content.
App scope required: READ
string
The ID of the content to be queried for its restrictions.
string
The operation type of the restrictions to be returned.
Valid values: read
, update
Array<string>
A multi-value parameter indicating which properties of the content restrictions to expand.
restrictions.user
returns the piece of content that the restrictions are
applied to. Expanded by default.restrictions.group
returns the piece of content that the restrictions are
applied to. Expanded by default.content
returns the piece of content that the restrictions are
applied to. form
integer
The starting index of the users and groups in the returned restrictions.
0
, Minimum: 0
, Format: int32
integer
The maximum number of users and the maximum number of groups, in the returned restrictions, to return per page. Note, this may be restricted by fixed system limits.
100
, Minimum: 0
, Format: int32
1 2 3 4
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
Returned if the requested restrictions are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
Returns whether the specified content restriction applies to a group. For example, if the 'admins' group has permission to read a page with an ID of 123, then the following request will return true:
https://your-domain.atlassian.net/wiki/rest/api/content/123/restriction/byOperation/read/group/admins
Permissions required: Permission to view the content.
App scope required: READ
string
The ID of the content that the restriction applies to.
string
The operation that the restriction applies to.
Valid values: read
, update
string
The name of the group to be queried for whether the content restriction applies to it.
1 2 3
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}' \
--user 'email@example.com:<api_token>'
Returns true if the content restriction applies to the group. The response will not return a response body.
A schema has not been defined for this response code.
PUT /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
Adds a group to a content restriction. That is, grant read or update permission to the group for a piece of content.
Permissions required: Permission to edit the content.
App scope required: WRITE
string
The ID of the content that the restriction applies to.
string
The operation that the restriction applies to.
Valid values: read
,