Rate this page:

Content

Get content

GET /wiki/rest/api/content

Returns all content in a Confluence instance.

By default, the following objects are expanded: space, history, version.

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 requiredREAD

OAuth scopes required
read:confluence-content.summary

Request

Query parameters
type

string

The type of content to return.

Default: page

Valid values: page, blogpost

spaceKey

string

The key of the space to be queried for its content.

title

string

The title of the page to be returned. Required for page type.

status

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.

postingDay

string

The posting date of the blog post to be returned. Required for blogpost type. Format: yyyy-mm-dd.

expand

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, including when they last viewed it, modified it, contributed to it, or added it as a favorite.
  • 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. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions.
  • 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. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions.
  • 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.
Style: form

Valid values: childTypes.all, childTypes.attachment, childTypes.comment, childTypes.page, container, metadata.currentuser, metadata.properties, metadata.labels, metadata.frontend, operations ...(Show more)

trigger

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

orderby

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

start

integer

The starting index of the returned content.

Default: 0, Minimum: 0, Format: int32
limit

integer

The maximum number of content objects to return per page. Note, this may be restricted by fixed system limits.

Default: 25, Minimum: 0, Format: int32

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content' \
  --header 'Accept: application/json'

Responses

Returned if the requested list of content is returned.

Content typeValue
application/json

ContentArray

Create content

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.

By default, the following objects are expanded: space, history, version.

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 requiredWRITE

OAuth scopes required
write:confluence-content

Request

Query parameters
status

string

Filter the returned content by status.

Default: current
expand

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, including when they last viewed it, modified it, contributed to it, or added it as a favorite.
  • 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. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions.
  • 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. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions.
  • 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.
Style: form

Valid values: childTypes.all, childTypes.attachment, childTypes.comment, childTypes.page, container, metadata.currentuser, metadata.properties, metadata.labels, metadata.frontend, operations ...(Show more)

Body parameters
id

string

The ID of the draft content. Required when publishing a draft.

title Required

string

Max length: 255
type Required

string

The type of the new content. Custom content types defined by apps are also supported.

Valid values: page, blogpost, comment, attachment

space Required

object

The space that the content is being created in.

status

string

The status of the new content.

Default: current

Valid values: current, trashed, historical, draft

ancestors

Array<object>

The parent content of the new content. Only one parent content id can be specified.

body Required

object

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.

Min properties: 1, Max properties: 1

Example

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 POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content' \
  --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"
    }
  }
}'

Responses

Returned if the content is created.

Content typeValue
application/json

Content

Publish shared draft

PUT /wiki/rest/api/content/blueprint/instance/{draftId}

Publishes a shared draft of a page created from a blueprint.

By default, the following objects are expanded: body.storage, history, space, version, ancestors.

Permissions required: Permission to view the draft and 'Add' permission for the space that the content will be created in.

App scope requiredWRITE

OAuth scopes required
write:confluence-content

Request

Path parameters
draftId Required

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.

Query parameters
status

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.

Default: draft
expand

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, including when they last viewed it, modified it, contributed to it, or added it as a favorite.
  • 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. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions.
  • 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. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions.
  • 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.
Style: form

Valid values: childTypes.all, childTypes.attachment, childTypes.comment, childTypes.page, container, metadata.currentuser, metadata.properties, metadata.labels, metadata.frontend, operations ...(Show more)

Body parameters
version Required

object

The version for the new content.

title Required

string

The title of the content. If you don't want to change the title, set this to the current title of the draft.

Max length: 255
type Required

string

The type of content. Set this to page.

Valid values: page

status

string

The status of the content. Set this to current or omit it altogether.

Default: current

Valid values: current

space

object

The space for the content.

ancestors

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.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/blueprint/instance/{draftId}' \
  --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>"
    }
  ]
}'

Responses

Returned if the draft was successfully published.

Content typeValue
application/json

Content

Publish legacy draft

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.

By default, the following objects are expanded: body.storage, history, space, version, ancestors.

Permissions required: Permission to view the draft and 'Add' permission for the space that the content will be created in.

App scope requiredWRITE

OAuth scopes required
write:confluence-content

Request

Path parameters
draftId Required

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.

Query parameters
status

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.

Default: draft
expand

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, including when they last viewed it, modified it, contributed to it, or added it as a favorite.
  • 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. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions.
  • 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. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions.
  • 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.
Style: form

Valid values: childTypes.all, childTypes.attachment, childTypes.comment, childTypes.page, container, metadata.currentuser, metadata.properties, metadata.labels, metadata.frontend, operations ...(Show more)

Body parameters
version Required

object

The version for the new content.

title Required

string

The title of the content. If you don't want to change the title, set this to the current title of the draft.

Max length: 255
type Required

string

The type of content. Set this to page.

Valid values: page

status

string

The status of the content. Set this to current or omit it altogether.

Default: current

Valid values: current

space

object

The space for the content.

ancestors

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.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/blueprint/instance/{draftId}' \
  --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>"
    }
  ]
}'

Responses

Returned if the draft was successfully published.

Content typeValue
application/json

Content

Search content by CQL

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.

Example initial call:

1
https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25

Example response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "results": [
    { ... },
    { ... },
    ...
    { ... }
  ],
  "limit": 25,
  "size": 25,
  ...
  "_links": {
    "base": "<url>",
    "context": "<url>",
    "next": "/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
    "self": "<url>"
  }
}

When additional results are available, returns next and prev URLs to retrieve them in subsequent calls. The URLs each contain a cursor that points to the appropriate set of results. Use limit to specify the number of results returned in each call. Example subsequent call (taken from example response):

1
https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg

The response to this will have a prev URL similar to the next in the example response.

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 requiredREAD

OAuth scopes required
search:confluence

Request

Query parameters
cql

string

The CQL string that is used to find the requested content.

cqlcontext

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

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, including when they last viewed it, modified it, contributed to it, or added it as a favorite.
  • 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. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions.
  • 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. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions.
  • 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.
Style: form

Valid values: childTypes.all, childTypes.attachment, childTypes.comment, childTypes.page, container, metadata.currentuser, metadata.properties, metadata.labels, metadata.frontend, operations ...(Show more)

cursor

string

Pointer to a set of search results, returned as part of the next or prev URL from the previous search call.

limit

integer

The maximum number of content objects to return per page. Note, this may be restricted by fixed system limits.

Default: 25, Minimum: 0, Format: int32

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/search' \
  --header 'Accept: application/json'

Responses

Returned if the requested list of content is returned.

Content typeValue
application/json

ContentArray

Get content by ID

GET /wiki/rest/api/content/{id}

Returns a single piece of content, like a page or a blog post.

By default, the following objects are expanded: space, history, version.

Permissions required: Permission to view the content. If the content is a blog post, 'View' permission for the space is required.

App scope requiredREAD

OAuth scopes required
read:confluence-content.summary

Request

Path parameters
id Required

string

The ID of the content to be returned. If you don't know the content ID, use Get content and filter the results.

Query parameters
status

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.

version

integer

The version number of the content to be returned.

Format: int32
embeddedContentRender

string

The version of embedded content (e.g. attachments) to render.

  • current renders the latest version of the embedded content.
  • version-at-save renders the version of the embedded content at the time of save.
Default: current

Valid values: current, version-at-save

expand

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, including when they last viewed it, modified it, contributed to it, or added it as a favorite.
  • 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. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions.
  • 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. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions.
  • 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.
Style: form

Valid values: childTypes.all, childTypes.attachment, childTypes.comment, childTypes.page, container, metadata.currentuser, metadata.properties, metadata.labels, metadata.frontend, operations ...(Show more)

trigger

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

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}' \
  --header 'Accept: application/json'

Responses

Returned if the requested content is returned.

Content typeValue
application/json

Content

Update content

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 requiredWRITE

OAuth scopes required
write:confluence-content

Request

Path parameters
id Required

string

The ID of the content to be updated.

Query parameters
status

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.

Default: current

Valid values: current, trashed, historical, draft

conflictPolicy

string

The action that should be taken when conflicts are discovered. Only used when publishing a draft page.

Default: abort

Valid values: abort

Body parameters
version Required

object

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.

title Required

string

The updated title of the content. If you are not changing this field, set this to the current title.

Max length: 255
type Required

string

The type of content. Set this to the current type of the content.

Valid values: page, blogpost, comment, attachment

status

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

ancestors

Array<object>

The new parent for the content. Only one parent content 'id' can be specified.

body

object

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.

Min properties: 1, Max properties: 1

Example

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
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}' \
  --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"
    }
  }
}'

Responses

Returned if the content is updated.

Content typeValue
application/json

Content

Delete content

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:

  • If the content's type is page or blogpost and its status is current, it will be trashed.
  • If the content's type is 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.
  • If the content's type is 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 requiredDELETE

OAuth scopes required
write:confluence-content

Request

Path parameters
id Required

string

The ID of the content to be deleted.

Query parameters
status

string

Set this to trashed, if the content's status is trashed and you want to purge it.

Example

1
2
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}'

Responses

Returned if the content is successfully trashed.

A schema has not been defined for this response code.

Get content history

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 requiredREAD

OAuth scopes required
read:confluence-content.summary

Request

Path parameters
id Required

string

The ID of the content to be queried for its history.

Query parameters
expand

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.
Style: form

Valid values: lastUpdated, previousVersion, contributors, nextVersion

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/history' \
  --header 'Accept: application/json'

Responses

Returned if the requested content history is returned.

Content typeValue
application/json

ContentHistory

Update content property

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 Confluence entity properties.

Permissions required: Permission to update the content.

App scope requiredWRITE

OAuth scopes required
write:confluence-props

Request

Path parameters
id Required

string

The ID of the content that the property belongs to.

key Required

string

The key of the property.

Body parameters
value Required

object

The value of the property.

Min properties: 1, Max properties: 1
version Required

object

The version number of the property.

Example

1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/property/{key}' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "value": {},
  "version": {
    "number": 201,
    "minorEdit": true
  }
}'

Responses

Returned if the content property is created.

Content typeValue
application/json

ContentProperty

Rate this page: