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 versions

Get content versions

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

Returns the versions for a piece of content in descending order.

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

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

Query parameters
start

integer

The starting index of the returned versions.

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

integer

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

Default: 200, Minimum: 0, Format: int32
expand

Array<string>

A multi-value parameter indicating which properties of the content to expand.

  • collaborators returns the users that collaborated on the version.
  • content returns the content for the version.
Style: form

Valid values: collaborators, content

Example

1
2
3
4
curl --request GET \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}/version' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested versions are returned.

Content typeValue
application/json

VersionArray

Restore content version

POST /wiki/rest/api/content/{id}/version

Restores a historical version to be the latest version. That is, a new version is created with the content of the historical version.

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 for which the history will be restored.

Query parameters
expand

Array<string>

A multi-value parameter indicating which properties of the returned content to expand.

  • collaborators returns the users that collaborated on the version.
  • content returns the content for the version.
Style: form

Valid values: collaborators, content

Body parameters
operationKey Required

string

Set to 'restore'.

Valid values: restore

params Required

object

Example

1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}/version' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "operationKey": "restore",
  "params": {
    "versionNumber": 34,
    "message": "<string>"
  }
}'

Responses

Returned if the version is restored.

Content typeValue
application/json

Version

Get content version

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

Returns a version 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.

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

versionNumber Required

integer

The number of the version to be retrieved.

Format: int32
Query parameters
expand

Array<string>

A multi-value parameter indicating which properties of the content to expand. By default, the content object is expanded.

  • collaborators returns the users that collaborated on the version.
  • content returns the content for the version.
Style: form

Valid values: collaborators, content

Example

1
2
3
4
curl --request GET \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}/version/{versionNumber}' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Returned if the version is returned.

Content typeValue
application/json

Version

Delete content version

DELETE /wiki/rest/api/content/{id}/version/{versionNumber}

Delete a historical version. This does not delete the changes made to the content in that version, rather the changes for the deleted version are rolled up into the next version. Note, you cannot delete the current version.

Permissions required: Permission to update the content.

Connect app scope requiredDELETE

OAuth scopes required
write:confluence-content

Request

Path parameters
id Required

string

The ID of the content that the version will be deleted from.

versionNumber Required

integer

The number of the version to be deleted. The version number starts from 1 up to current version.

Format: int32

Example

1
2
3
curl --request DELETE \
  --url 'https://api.atlassian.com/ex/confluence/:cloudId:/wiki/rest/api/content/{id}/version/{versionNumber}' \
  --header 'Authorization: Bearer <access_token>'

Responses

Returned if the version is deleted.

A schema has not been defined for this response code.

Rate this page: