Audit
Content
Content - attachments
Content body
Content - children and descendants
Content - macro body
Content comments
Content labels
Content permissions
Content properties
Content restrictions
Content versions
Content watches
Dynamic modules
Group
Inline tasks
Label info
Long-running task
Relation
Search
Settings
Space
Space permissions
Space properties
Space settings
Template
Themes
Users

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.

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

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

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
4
curl --request GET \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content' \
  --header 'Authorization: Bearer <access_token>' \
  --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.

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

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

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

container

object

The container of the content. Required if type is comment or certain types of custom content. If you are trying to create a comment that is a child of another comment, specify the parent comment in the ancestors field, not in this field.

ancestors

Array<object>

The parent content of the new content. If you are creating a top-level page or comment, this can be left blank. If you are creating a child page, this is where the parent page id goes. If you are creating a child comment, this is where the parent comment id goes. 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.

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
45
46
47
48
49
curl --request POST \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "<string>",
  "title": "<string>",
  "type": "page",
  "space": {
    "key": "<string>"
  },
  "status": "current",
  "container": {
    "id": "<string>",
    "type": "<string>"
  },
  "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

Archive pages

Experimental

POST /wiki/rest/api/content/archive

Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/ REST API to get the copy task status.

Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need not belong to the same space.

Permissions required: 'Archive' permission for each of the pages in the corresponding space it belongs to.

Connect app scope requiredWRITE

OAuth scopes required
write:confluence-content

Request

Body parameters
pages

Array<object>

Example

1
2
3
curl --request POST \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/archive' \
  --header 'Authorization: Bearer <access_token>'

Responses

Returned if the archive request has been submitted.

A schema has not been defined for this response code.

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.

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

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
21
curl --request PUT \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/blueprint/instance/{draftId}' \
  --header 'Authorization: Bearer <access_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>"
    }
  ]
}'

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.

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

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
21
curl --request POST \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/blueprint/instance/{draftId}' \
  --header 'Authorization: Bearer <access_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>"
    }
  ]
}'

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

Connect app scope requiredREAD

OAuth scopes required
search:confluence

Request

Query parameters
cql Required

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.

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
4
curl --request GET \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/search?cql={cql}' \
  --header 'Authorization: Bearer <access_token>' \
  --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.

Connect app scope requiredREAD

OAuth scopes required
read:confluence-content.summary

Request

Path parameters
id Required

string

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.

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

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
4
curl --request GET \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}' \
  --header 'Authorization: Bearer <access_token>' \
  --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.

Connect 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

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

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 PUT \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}' \
  --header 'Authorization: Bearer <access_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": "storage"
    },
    "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.

Connect 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
3
curl --request DELETE \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}' \
  --header 'Authorization: Bearer <access_token>'

Responses

Returned if the content is successfully trashed or purged.

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.

Connect 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
4
curl --request GET \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}/history' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested content history is returned.

Content typeValue
application/json

ContentHistory

Rate this page: