About

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 and authorization

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.

Status codes

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:

Copy
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."
}

Using the REST API

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:

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

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

Capabilities

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.

Audit

Get audit records

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.

Request

Query parameters
startDate

string

Filters the results to the records on or after the startDate. The startDate must be specified as a timestamp.

endDate

string

Filters the results to the records on or before the endDate. The endDate must be specified as a timestamp.

searchString

string

Filters the results to records that have string property values matching the searchString.

start

integer

The starting index of the returned records.

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

integer

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

Default: 1000, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested records are returned.

Content typeValue
application/json

AuditRecordArray

Create audit record

POST /wiki/rest/api/audit

Creates a record in the audit log.

Permissions required: 'Confluence Administrator' global permission.

Apps cannot access this REST resource.

Request

Body parameters
author

object

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

remoteAddress Required

string

The IP address of the computer where the event was initiated from.

creationDate

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.

Format: int64
summary

string

The summary of the event, which is displayed in the 'Change' column on the audit log in the Confluence UI.

description

string

A long description of the event, which is displayed in the 'Description' field on the audit log in the Confluence UI.

category

string

The category of the event, which is displayed in the 'Event type' column on the audit log in the Confluence UI.

sysAdmin

boolean

Indicates whether the event was actioned by a system administrator.

Default: false
affectedObject

AffectedObject

changedValues

Array<ChangedValue>

The values that were changed in the event.

associatedObjects

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.

Example

Copy
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>"
    }
  ]
}'

Responses

Returned if the record is created in the audit log.

Content typeValue
application/json

AuditRecord

Export audit records

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.

Request

Query parameters
startDate

string

Filters the exported results to the records on or after the startDate. The startDate must be specified as a timestamp.

endDate

string

Filters the exported results to the records on or before the endDate. The endDate must be specified as a timestamp.

searchString

string

Filters the exported results to records that have string property values matching the searchString.

format

string

The format of the export file for the audit records.

Default: csv

Valid values: csv, zip

Example

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

Responses

Returned if the requested export of the audit records is returned.

Content typeValue
application/zip

string

text/csv

string

Get retention period

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.

Request

There are no parameters for this request.

Example

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

Responses

Returned if the requested retention period is returned.

Content typeValue
application/json

RetentionPeriod

Set retention period

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.

Request

Body parameters
number Required

integer

The number of units for the retention period.

Format: int32
units Required

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)

Example

Copy
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"
}'

Responses

Returned if the retention period is updated.

Content typeValue
application/json

RetentionPeriod

Get audit records for time period

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.

Request

Query parameters
number

integer

The number of units for the time period.

Default: 3, Format: int64
units

string

The unit of time that the time period is measured in.

Default: MONTHS

Valid values: NANOS, MICROS, MILLIS, SECONDS, MINUTES, HOURS, HALF_DAYS, DAYS, WEEKS, MONTHS ...(Show more)

searchString

string

Filters the results to records that have string property values matching the searchString.

start

integer

The starting index of the returned records.

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

integer

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

Default: 1000, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested records are returned.

Content typeValue
application/json

AuditRecordArray

Content

Get content

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 requiredREAD

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.

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

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

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.

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

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

Copy
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"
    }
  }
}'

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.

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

App scope requiredWRITE

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

Copy
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>"
    }
  ]
}'

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 favour 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 requiredWRITE

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

Copy
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>"
    }
  ]
}'

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.

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

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

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

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.

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

App scope requiredREAD

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.

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

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

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

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 favour 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

Copy
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"
    }
  }
}'

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

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

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the content is successfully trashed.

A schema has not been defined for this response code.

Get content children

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
expand

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

integer

The version of the parent content to retrieve children for. Currently, this only works for the latest version.

Default: 0, Format: int32

Example

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

Responses

Returned if the requested content children are returned.

Content typeValue
application/json

ContentChildren

Get attachments

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
expand

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

integer

The starting index of the returned attachments.

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

integer

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

Default: 25, Minimum: 0, Format: int32
filename

string

Filter the results to attachments that match the filename.

mediaType

string

Filter the results to attachments that match the media type.

Example

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

Responses

Returned if the requested attachments are returned.

Content typeValue
application/json

ContentArray

Create or update attachment

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.

Copy
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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content to add the attachment to.

Query parameters
status

string

The status of the content that the attachment is being added to. This should always be set to 'current'.

Default: current

Valid values: current, draft

Body parameters
Content typeValue
multipart/form-data

object

Example

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

Responses

Returned if the attachments were added to the content.

Content typeValue
application/json

ContentArray

Create attachment

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.

Copy
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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content to add the attachment to.

Query parameters
status

string

The status of the content that the attachment is being added to.

Default: current

Valid values: current, draft

Body parameters
Content typeValue
multipart/form-data

object

Example

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

Responses

Returned if the attachments were added to the content.

Content typeValue
application/json

ContentArray

Update attachment properties

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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content that the attachment is attached to.

attachmentId Required

string

The ID of the attachment to update.

Body parameters
version Required

object

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.

id Required

string

The ID of the attachment to be updated.

type Required

string

Set this to attachment.

Valid values: attachment

title

string

The updated name of the attachment.

Max length: 255
metadata

object

container

object

The new content to attach the attachment to.

Example

Copy
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>"
  }
}'

Responses

Returned if the attachment is updated.

Content typeValue
application/json

Content

Update attachment data

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.

Copy
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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content that the attachment is attached to.

attachmentId Required

string

The ID of the attachment to update.

Body parameters
Content typeValue
multipart/form-data

object

Example

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

Responses

Returned if the attachment is updated.

Content typeValue
application/json

Content

Get content comments

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
expand

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

integer

The version of the parent content to retrieve children for. Currently, this only works for the latest version.

Default: 0, Minimum: 0, Format: int32
start

integer

The starting index of the returned comments.

Format: int32
limit

integer

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

Default: 25, Minimum: 0, Format: int32
location

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.

depth

string

Currently, this parameter is not used. Comments are returned at the root level only.

Example

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

Responses

Returned if the requested comments are returned.

Content typeValue
application/json

ContentArray

Get content children by type

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 requiredREAD

Request

Path parameters
id Required

string

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

type Required

string

The type of children to return.

Valid values: page, comment, attachment

Query parameters
expand

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

integer

The version of the parent content to retrieve children for. Currently, this only works for the latest version.

Default: 0, Minimum: 0, Format: int32
start

integer

The starting index of the returned content.

Format: int32
limit

integer

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

Default: 25, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested content is returned.

Content typeValue
application/json

ContentArray

Get content descendants

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
expand

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

Example

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

Responses

Returned if the requested descendants are returned.

Content typeValue
application/json

ContentChildren

Get content descendants by type

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 requiredREAD

Request

Path parameters
id Required

string

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

type Required

string

The type of descendants to return.

Valid values: page, comment, attachment

Query parameters
expand

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

integer

The starting index of the returned content.

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

integer

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

Default: 25, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested content is returned.

Content typeValue
application/json

ContentArray

Get history for content

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

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

Example

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

Responses

Returned if the requested content history is returned.

Content typeValue
application/json

ContentHistory

Get macro body by macro ID

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 requiredREAD

Request

Path parameters
id Required

string

The ID for the content that contains the macro.

version Required

integer

The version of the content that contains the macro.

Format: int32
macroId Required

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

Example

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

Responses

Returned if the requested macro body is returned.

Content typeValue
application/json

MacroInstance

Get labels for content

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
prefix

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

start

integer

The starting index of the returned labels.

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

integer

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

Default: 200, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested labels are returned.

Content typeValue
application/json

LabelArray

Add labels to content

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

Adds labels to a piece of content. Does not modify the existing labels.

Notes:

  • Labels can also be added when creating content (Create content).
  • Labels can be updated when updating content (Update content). This will delete the existing labels and replace them with the labels in the request.

Permissions required: Permission to update the content.

App scope requiredWRITE

Request

Path parameters
id Required

string

The ID of the content that will have labels added to it.

Body parameters

Example

Copy
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>"
  }
]'

Responses

Returned if the labels are added to the content.

Content typeValue
application/json

LabelArray

Remove label from content using query parameter

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 requiredDELETE

Request

Path parameters
id Required

string

The ID of the content that the label will be removed from.

Query parameters
name

string

The name of the label to be removed.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/label' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the label is removed. The response body will be empty.

Remove label from content

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 requiredDELETE

Request

Path parameters
id Required

string

The ID of the content that the label will be removed from.

label Required

string

The name of the label to be removed.

Example

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

Responses

Returned if the label is removed. The response body will be empty.

Get watches for page

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
start

integer

The starting index of the returned watches.

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

integer

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

Default: 200, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested watches are returned.

Content typeValue
application/json

WatchArray

Get watches for space

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
start

integer

The starting index of the returned watches.

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

integer

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

Default: 200, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested watches are returned.

Content typeValue
application/json

WatchArray

Copy page hierarchy

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 requiredWRITE

Request

Path parameters
id Required

string

Body parameters
copyAttachments

boolean

copyPermissions

boolean

copyProperties

boolean

copyLabels

boolean

originalPageId

string

destinationPageId

string

titleOptions

CopyPageHierarchyTitleOptions

Example

Copy
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>"
  }
}'

Responses

Returns a full JSON representation of a long running task

A schema has not been defined for this response code.

Get content properties

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
expand

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

integer

The starting index of the returned properties.

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

integer

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

Default: 10, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested properties are returned.

Content typeValue
application/json

ContentPropertyArray

Create content property

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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content to add the property to.

Body parameters
key Required

string

The key of the new property.

Max length: 255
value Required

PropertyValue

The value of the property. This can be empty or a complex object. For example,

Copy
1
2
3
4
5
"value": {
  "example1": "value",
  "example2": true,
  "example3": 123
}

Example

Copy
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": {}
}'

Responses

Returned if the content property is created.

Content typeValue
application/json

ContentProperty

Get content property

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 requiredREAD

Request

Path parameters
id Required

string

The ID of the content to be queried for the property.

key Required

string

The key of the content property.

Query parameters
expand

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

Example

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

Responses

Returned if the content property is returned.

Content typeValue
application/json

ContentProperty

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 Content properties in the REST API.

Permissions required: Permission to update the content.

App scope requiredWRITE

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

Copy
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
  }
}'

Responses

Returned if the content property is created.

Content typeValue
application/json

ContentProperty

Create content property for key

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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content to add the property to.

key Required

string

The key of the content property. Required.

Body parameters
value Required

PropertyValue

The value of the property. This can be empty or a complex object. For example,

Copy
1
2
3
4
5
"value": {
  "example1": "value",
  "example2": true,
  "example3": 123
}

Example

Copy
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": {}
}'

Responses

Returned if the content property is created.

Content typeValue
application/json

ContentProperty

Delete content property

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 requiredDELETE

Request

Path parameters
id Required

string

The ID of the content that the property belongs to.

key Required

string

The key of the property.

Example

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

Responses

Returned if the content property is deleted.

Get restrictions

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

Returns the restrictions on a piece of content.

Permissions required: Permission to view the content.

App scope requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
expand

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

integer

The starting index of the users and groups in the returned restrictions.

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

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.

Default: 100, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested restrictions are returned.

Content typeValue
application/json

ContentRestrictionArray

Update restrictions

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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content to update restrictions for.

Query parameters
expand

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

Example

Copy
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
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>"
        }
      ],
      "group": [
        {
          "type": "group",
          "name": "<string>"
        }
      ]
    }
  }
]'

Responses

Returned if the requested restrictions are updated.

Content typeValue
application/json

ContentRestrictionArray

Add restrictions

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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content to add restrictions to.

Query parameters
expand

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

Example

Copy
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
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>"
        }
      ],
      "group": [
        {
          "type": "group",
          "name": "<string>"
        }
      ]
    }
  }
]'

Responses

Returned if the requested restrictions are added.

Content typeValue
application/json

ContentRestrictionArray

Delete restrictions

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 requiredDELETE

Request

Path parameters
id Required

string

The ID of the content to remove restrictions from.

Query parameters
expand

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

Example

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

Responses

Returned if the restrictions are removed.

Content typeValue
application/json

ContentRestrictionArray

Get restrictions by operation

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 requiredREAD

Request

Path parameters
id Required

string

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

Query parameters
expand

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

Example

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

Responses

Returned if the requested restrictions are returned.

Content typeValue
application/json

object

Get restrictions for operation

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 requiredREAD

Request

Path parameters
id Required

string

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

operationKey Required

string

The operation type of the restrictions to be returned.

Valid values: read, update

Query parameters
expand

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

integer

The starting index of the users and groups in the returned restrictions.

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

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.

Default: 100, Minimum: 0, Format: int32

Example

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

Responses

Returned if the requested restrictions are returned.

Content typeValue
application/json

ContentRestriction

Get content restriction status for group

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 requiredREAD

Request

Path parameters
id Required

string

The ID of the content that the restriction applies to.

operationKey Required

string

The operation that the restriction applies to.

Valid values: read, update

groupName Required

string

The name of the group to be queried for whether the content restriction applies to it.

Example

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

Responses

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.

Add group to content restriction

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 requiredWRITE

Request

Path parameters
id Required

string

The ID of the content that the restriction applies to.

operationKey Required

string

The operation that the restriction applies to.

Valid values: read, update

groupName Required

string

The name of the group to add to the content restriction.

Example

Copy
1
2
3
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the group is added to the content restriction. The response body will be empty.

A schema has not been defined for this response code.

Remove group from content restriction

DELETE /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}

Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.

Permissions required: Permission to edit the content.

App scope requiredDELETE

Request

Path parameters
id Required

string

The ID of the content that the restriction applies to.

operationKey Required

string

The operation that the restriction applies to.

Valid values: read, update

groupName Required

string

The name of the group to remove from the content restriction.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the group is removed from the content restriction. The response body will be empty.

A schema has not been defined for this response code.

Get content restriction status for user

GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user

Returns whether the specified content restriction applies to a user. For example, if the user 'admin' 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/user?username=admin

One of key, username, or accountId must be specified as a query parameter to identify the user.

Permissions required: Permission to view the content.

App scope requiredREAD

Request

Path parameters
id Required

string

The ID of the content that the restriction applies to.

operationKey Required

string

The operation that is restricted.

Query parameters
key

string

The key of the user to be queried for whether the content restriction applies to it.

userName

string

The username of the user to be queried for whether the content restriction applies to it.

accountId

string

The account ID of the user to be queried for whether the content restriction applies to it.

Example

Copy
1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user' \
  --user 'email@example.com:<api_token>'

Responses

Return true if the content restriction applies to the user. The response body will be empty.

A schema has not been defined for this response code.

Add user to content restriction

PUT /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user

Adds a user to a content restriction. That is, grant read or update permission to the user for a piece of content.

One of key, username, or accountId must be specified as a query parameter to identify the user.

Permissions required: Permission to edit the content.

App scope requiredWRITE

Request

Path parameters
id Required

string

The ID of the content that the restriction applies to.

operationKey Required

string

The operation that the restriction applies to.

Query parameters
key

string

The key of the user to add to the content restriction.

userName

string

The username of the user to add to the content restriction.

accountId

string

The account ID of the user to add to the content restriction.

Example

Copy
1
2
3
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the user is added to the content restriction. The response body will be empty.

A schema has not been defined for this response code.

Remove user from content restriction

DELETE /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user

Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.

Permissions required: Permission to edit the content.

App scope requiredDELETE

Request

Path parameters
id Required

string

The ID of the content that the restriction applies to.

operationKey Required

string

The operation that the restriction applies to.

Valid values: read, update

Query parameters
key

string

The key of the user to remove from the content restriction.

userName

string

The username of the user to remove from the content restriction.

accountId

string

The account ID of the user to remove from the content restriction.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the user is removed from the content restriction. The response body will be empty.

A schema has not been defined for this response code.

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.

App scope requiredREAD

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

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/version' \
  --user 'email@example.com:<api_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.

App scope requiredWRITE

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
Body parameters
operationKey Required

string

Set to 'RESTORE'.

Valid values: RESTORE

params Required

object

Example

Copy
1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/version' \
  --user 'email@example.com:<api_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.

App scope requiredREAD

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

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/version/{versionNumber}' \
  --user 'email@example.com:<api_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.

App scope requiredDELETE

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

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/version/{versionNumber}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the version is deleted.

Contentbody

Convert content body

POST /wiki/rest/api/contentbody/convert/{to}

Converts a content body from one format to another format.

Supported conversions:

  • storage: view, export_view, styled_view, editor
  • editor: storage
  • view: none
  • export_view: none
  • styled_view: none

Permissions required: If request specifies 'contentIdContext', 'View' permission for the space, and permission to view the content.

App scope requiredREAD

Request

Path parameters
to Required

string

The name of the target format for the content body.

Query parameters
expand

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

string

The space key used for resolving embedded content (page includes, files, and links) in the content body. For example, if the source content contains the link <ac:link><ri:page ri:content-title="Example page" /><ac:link> and the spaceKeyContext=TEST parameter is provided, then the link will be converted to a link to the "Example page" page in the "TEST" space.

contentIdContext

string

The content ID used to find the space for resolving embedded content (page includes, files, and links) in the content body. For example, if the source content contains the link <ac:link><ri:page ri:content-title="Example page" /><ac:link> and the contentIdContext=123 parameter is provided, then the link will be converted to a link to the "Example page" page in the same space that has the content with ID=123. Note, spaceKeyContext will be ignored if this parameter is provided.

embeddedContentRender

string

Mode used for rendering embedded content, like attachments.

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

Valid values: current, version-at-save

Body parameters

This object is used when creating or updating content.

value Required

string

The body of the content in the relevant format.

representation Required

string

The content format type. Set the value of this property to the name of the format being used, e.g. 'storage'.

Valid values: view, export_view, styled_view, storage, editor2, anonymous_export_view

Example

Copy
1
2
3
4
5
6
7
8
9
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/contentbody/convert/{to}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "value": "<string>",
  "representation": "view"
}'

Responses

Returned if the content is converted.

Content typeValue
application/json

ContentBody

Group

Get groups

GET /wiki/rest/api/group

Returns all user groups. The returned groups are ordered alphabetically in ascending order by group name.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Query parameters
start

integer

The starting index of the returned groups.

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

integer

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

Default: 200, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/group' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested groups are returned.

Content typeValue
application/json

allOf [GroupArray, object]

Get group

GET /wiki/rest/api/group/{groupName}

Returns a user group for a given group name.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Path parameters
groupName Required

string

The name of the group. This is the same as the group name shown in the Confluence administration console.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/group/{groupName}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested group is returned.

Content typeValue
application/json

Group

Get group members

GET /wiki/rest/api/group/{groupName}/member

Returns the users that are members of a group.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Path parameters
groupName Required

string

The name of the group to be queried for its members.

Query parameters
start

integer

The starting index of the returned users.

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

integer

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

Default: 200, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/group/{groupName}/member' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested users are returned.

Content typeValue
application/json

allOf [UserArray, object]

Longtask

Get long-running tasks

GET /wiki/rest/api/longtask

Returns information about all active long-running tasks (e.g. space export), such as how long each task has been running and the percentage of each task that has completed.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Query parameters
start

integer

The starting index of the returned tasks.

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

integer

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

Default: 100, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/longtask' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested tasks are returned.

Content typeValue
application/json

LongTaskStatusArray

Get long-running task

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

Returns information about an active long-running task (e.g. space export), such as how long it has been running and the percentage of the task that has completed.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Path parameters
id Required

string

The ID of the task.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/longtask/{id}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested task is returned.

Content typeValue
application/json

allOf [LongTaskStatus, object]

Relation

Find target entities related to a source entity

GET /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}

Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.

For example, the following method finds all content that the current user has an 'ignore' relationship with: GET https://your-domain.atlassian.net/wiki/rest/api/relation/ignore/from/user/current/to/content Note, 'ignore' is an example custom relationship type.

Permissions required: Permission to view both the target entity and source entity.

App scope requiredREAD

Request

Path parameters
relationName Required

string

The name of the relationship. This method supports relationships created via Create relationship. Note, this method does not support 'favourite' relationships.

sourceType Required

string

The source entity type of the relationship.

Valid values: user, content, space

sourceKey Required

string

  • The identifier for the source entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
targetType Required

string

The target entity type of the relationship.

Valid values: user, content, space

Query parameters
sourceStatus

string

The status of the source. This parameter is only used when the sourceType is 'content'.

targetStatus

string

The status of the target. This parameter is only used when the targetType is 'content'.

sourceVersion

integer

The version of the source. This parameter is only used when the sourceType is 'content' and the sourceStatus is 'historical'.

Format: int32
targetVersion

integer

The version of the target. This parameter is only used when the targetType is 'content' and the targetStatus is 'historical'.

Format: int32
expand

Array<string>

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

  • relationData returns information about the relationship, such as who created it and when it was created.
  • source returns the source entity.
  • target returns the target entity.
Style: form
start

integer

The starting index of the returned relationships.

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

integer

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

Default: 25, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested relationships are returned.

Content typeValue
application/json

RelationArray

Find relationship from source to target

GET /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}

Find whether a particular type of relationship exists from a source entity to a target entity. Note, relationships are one way.

For example, you can use this method to find whether the current user has selected a particular page as a favorite (i.e. 'save for later'): GET https://your-domain.atlassian.net/wiki/rest/api/relation/favourite/from/user/current/to/content/123

Permissions required: Permission to view both the target entity and source entity.

App scope requiredREAD

Request

Path parameters
relationName Required

string

The name of the relationship. This method supports the 'favourite' (i.e. 'save for later') relationship as well as any other relationship types created via Create relationship.

sourceType Required

string

The source entity type of the relationship. This must be 'user', if the relationName is 'favourite'.

Valid values: user, content, space

sourceKey Required

string

  • The identifier for the source entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
targetType Required

string

The target entity type of the relationship. This must be 'space' or 'content', if the relationName is 'favourite'.

Valid values: user, content, space

targetKey Required

string

  • The identifier for the target entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
Query parameters
sourceStatus

string

The status of the source. This parameter is only used when the sourceType is 'content'.

targetStatus

string

The status of the target. This parameter is only used when the targetType is 'content'.

sourceVersion

integer

The version of the source. This parameter is only used when the sourceType is 'content' and the sourceStatus is 'historical'.

Format: int32
targetVersion

integer

The version of the target. This parameter is only used when the targetType is 'content' and the targetStatus is 'historical'.

Format: int32
expand

Array<string>

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

  • relationData returns information about the relationship, such as who created it and when it was created.
  • source returns the source entity.
  • target returns the target entity.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the relationship exists.

Content typeValue
application/json

Relation

Create relationship

PUT /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}

Creates a relationship between two entities (user, space, content). The 'favourite' relationship is supported by default, but you can use this method to create any type of relationship between two entities.

For example, the following method creates a 'sibling' relationship between two pieces of content: GET https://your-domain.atlassian.net/wiki/rest/api/relation/sibling/from/content/123/to/content/456

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredWRITE

Request

Path parameters
relationName Required

string

The name of the relationship. This method supports the 'favourite' (i.e. 'save for later') relationship. You can also specify any other value for this parameter to create a custom relationship type.

sourceType Required

string

The source entity type of the relationship. This must be 'user', if the relationName is 'favourite'.

Valid values: user, content, space

sourceKey Required

string

  • The identifier for the source entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
targetType Required

string

The target entity type of the relationship. This must be 'space' or 'content', if the relationName is 'favourite'.

Valid values: user, content, space

targetKey Required

string

  • The identifier for the target entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
Query parameters
sourceStatus

string

The status of the source. This parameter is only used when the sourceType is 'content'.

targetStatus

string

The status of the target. This parameter is only used when the targetType is 'content'.

sourceVersion

integer

The version of the source. This parameter is only used when the sourceType is 'content' and the sourceStatus is 'historical'.

Format: int32
targetVersion

integer

The version of the target. This parameter is only used when the targetType is 'content' and the targetStatus is 'historical'.

Format: int32

Example

Copy
1
2
3
4
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the relationship is created.

Content typeValue
application/json

Relation

Delete

DELETE /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}

Deletes a relationship between two entities (user, space, content).

Permissions required: Permission to access the Confluence site ('Can use' global permission). For favourite relationships, the current user can only delete their own favourite relationships. A space administrator can delete favourite relationships for any user.

App scope requiredDELETE

Request

Path parameters
relationName Required

string

The name of the relationship.

sourceType Required

string

The source entity type of the relationship. This must be 'user', if the relationName is 'favourite'.

Valid values: user, content, space

sourceKey Required

string

  • The identifier for the source entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
targetType Required

string

The target entity type of the relationship. This must be 'space' or 'content', if the relationName is 'favourite'.

Valid values: user, content, space

targetKey Required

string

  • The identifier for the target entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
Query parameters
sourceStatus

string

The status of the source. This parameter is only used when the sourceType is 'content'.

targetStatus

string

The status of the target. This parameter is only used when the targetType is 'content'.

sourceVersion

integer

The version of the source. This parameter is only used when the sourceType is 'content' and the sourceStatus is 'historical'.

Format: int32
targetVersion

integer

The version of the target. This parameter is only used when the targetType is 'content' and the targetStatus is 'historical'.

Format: int32

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the relationship is deleted or the relationship didn't exist.

Find target entities related to a source entity

GET /wiki/rest/api/relation/{relationName}/to/{targetType}/{targetKey}/from/{sourceType}

Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.

For example, the following method finds all users that have a 'collaborator' relationship to a piece of content with an ID of '1234': GET https://your-domain.atlassian.net/wiki/rest/api/relation/collaborator/to/content/1234/from/user Note, 'collaborator' is an example custom relationship type.

Permissions required: Permission to view both the target entity and source entity.

App scope requiredREAD

Request

Path parameters
relationName Required

string

The name of the relationship. This method supports relationships created via Create relationship. Note, this method does not support 'favourite' relationships.

sourceType Required

string

The source entity type of the relationship.

Valid values: user, content, space

targetType Required

string

The target entity type of the relationship.

Valid values: user, content, space

targetKey Required

string

  • The identifier for the target entity:

  • If sourceType is 'user', then specify either 'current' (logged-in user) or the user key.
  • If sourceType is 'content', then specify the content ID.
  • If sourceType is 'space', then specify the space key.
Query parameters
sourceStatus

string

The status of the source. This parameter is only used when the sourceType is 'content'.

targetStatus

string

The status of the target. This parameter is only used when the targetType is 'content'.

sourceVersion

integer

The version of the source. This parameter is only used when the sourceType is 'content' and the sourceStatus is 'historical'.

Format: int32
targetVersion

integer

The version of the target. This parameter is only used when the targetType is 'content' and the targetStatus is 'historical'.

Format: int32
expand

Array<string>

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

  • relationData returns information about the relationship, such as who created it and when it was created.
  • source returns the source entity.
  • target returns the target entity.
Style: form
start

integer

The starting index of the returned relationships.

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

integer

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

Default: 25, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/to/{targetType}/{targetKey}/from/{sourceType}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested relationships are returned.

Content typeValue
application/json

RelationArray

Search

GET /wiki/rest/api/search

Searches for content using the Confluence Query Language (CQL)

Permissions required: Permission to view the entities. Note, only entities that the user has permission to view will be returned.

App scope requiredREAD

Request

Query parameters
cql Required

string

The CQL query to be used for the search. See Advanced Searching using CQL for instructions on how to build a CQL query.

cqlcontext

string

The space, content, and content status to execute the search against.

  • spaceKey Key of the space to search against. Optional.
  • contentId ID of the content to search against. Optional. Must be in the space specified by spaceKey.
  • contentStatuses Content statuses to search against. Optional.

Specify these values in an object. For example, cqlcontext={%22spaceKey%22:%22TEST%22, %22contentId%22:%22123%22}

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
includeArchivedSpaces

boolean

Include content from archived spaces in the results.

Default: false

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/search' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested results are returned.

Content typeValue
application/json

SearchPageResponseSearchResult

Settings

Get look and feel settings

GET /wiki/rest/api/settings/lookandfeel

Returns the look and feel settings for the site or a single space. This includes attributes such as the color scheme, padding, and border radius.

The look and feel settings for a space can be inherited from the global look and feel settings or provided by a theme.

Permissions required: None

App scope requiredREAD

Request

Query parameters
spaceKey

string

The key of the space for which the look and feel settings will be returned. If this is not set, only the global look and feel settings are returned.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/lookandfeel' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested look and feel settings are returned.

Content typeValue
application/json

LookAndFeelSettings

Update look and feel settings

POST /wiki/rest/api/settings/lookandfeel/custom

Updates the look and feel settings for the site or for a single space. If custom settings exist, they are updated. If no custom settings exist, then a set of custom settings is created.

Note, if a theme is selected for a space, the space look and feel settings are provided by the theme and cannot be overridden.

Permissions required: 'Admin' permission for the space.

App scope requiredWRITE

Request

Query parameters
spaceKey

string

The key of the space for which the look and feel settings will be updated. If this is not set, the global look and feel settings will be updated.

Body parameters
headings Required

object

links Required

object

menus Required

MenusLookAndFeel

header Required

HeaderLookAndFeel

content Required

ContentLookAndFeel

bordersAndDividers Required

object

Example

Copy
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/lookandfeel/custom' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "headings": {
    "color": "<string>"
  },
  "links": {
    "color": "<string>"
  },
  "menus": {
    "hoverOrFocus": {
      "backgroundColor": "<string>"
    },
    "color": "<string>"
  },
  "header": {
    "backgroundColor": "<string>",
    "button": {
      "backgroundColor": "<string>",
      "color": "<string>"
    },
    "primaryNavigation": {
      "color": "<string>",
      "hoverOrFocus": {
        "backgroundColor": "<string>",
        "color": "<string>"
      }
    },
    "secondaryNavigation": {
      "color": "<string>",
      "hoverOrFocus": {
        "backgroundColor": "<string>",
        "color": "<string>"
      }
    },
    "search": {
      "backgroundColor": "<string>",
      "color": "<string>"
    }
  },
  "content": {
    "screen": {
      "background": "<string>",
      "backgroundColor": "<string>",
      "backgroundImage": "<string>",
      "backgroundSize": "<string>",
      "gutterTop": "<string>",
      "gutterRight": "<string>",
      "gutterBottom": "<string>",
      "gutterLeft": "<string>"
    },
    "container": {
      "background": "<string>",
      "backgroundColor": "<string>",
      "backgroundImage": "<string>",
      "backgroundSize": "<string>",
      "padding": "<string>",
      "borderRadius": "<string>"
    },
    "header": {
      "background": "<string>",
      "backgroundColor": "<string>",
      "backgroundImage": "<string>",
      "backgroundSize": "<string>",
      "padding": "<string>",
      "borderRadius": "<string>"
    },
    "body": {
      "background": "<string>",
      "backgroundColor": "<string>",
      "backgroundImage": "<string>",
      "backgroundSize": "<string>",
      "padding": "<string>",
      "borderRadius": "<string>"
    }
  },
  "bordersAndDividers": {
    "color": "<string>"
  }
}'

Responses

Returned if the look and feel settings are updated.

Content typeValue
application/json

allOf [LookAndFeel, object]

Reset look and feel settings

DELETE /wiki/rest/api/settings/lookandfeel/custom

Resets the custom look and feel settings for the site or a single space. This changes the values of the custom settings to be the same as the default settings. It does not change which settings (default or custom) are selected. Note, the default space settings are inherited from the current global settings.

Permissions required: 'Admin' permission for the space.

App scope requiredDELETE

Request

Query parameters
spaceKey

string

The key of the space for which the look and feel settings will be reset. If this is not set, the global look and feel settings will be reset.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/lookandfeel/custom' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the look and feel settings have been reset.

Set look and feel settings

PUT /wiki/rest/api/settings/lookandfeel/selected

Sets the look and feel settings to either the default settings or the custom settings, for the site or a single space. Note, the default space settings are inherited from the current global settings.

Permissions required: 'Admin' permission for the space.

App scope requiredWRITE

Request

Query parameters
spaceKey

string

The key of the space for which the look and feel settings will be set. If this is not set, the global look and feel settings will be set.

Body parameters

The object for choosing the look and feel settings for the site or a space.

selected Required

string

The look and feel scheme. If you set this to global, you must specify the current global look and feel settings as a global object in this request. Similarly, if you set this to custom, you must specify the current custom look and feel settings as a custom object in this request.

Valid values: global, custom

global

LookAndFeel

custom

LookAndFeel

Example

Copy
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/lookandfeel/selected' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "selected": "global",
  "global": {
    "headings": {
      "color": "<string>"
    },
    "links": {
      "color": "<string>"
    },
    "menus": {
      "hoverOrFocus": {
        "backgroundColor": "<string>"
      },
      "color": "<string>"
    },
    "header": {
      "backgroundColor": "<string>",
      "button": {
        "backgroundColor": "<string>",
        "color": "<string>"
      },
      "primaryNavigation": {
        "color": "<string>",
        "hoverOrFocus": {
          "backgroundColor": "<string>",
          "color": "<string>"
        }
      },
      "secondaryNavigation": {
        "color": "<string>",
        "hoverOrFocus": {
          "backgroundColor": "<string>",
          "color": "<string>"
        }
      },
      "search": {
        "backgroundColor": "<string>",
        "color": "<string>"
      }
    },
    "content": {
      "screen": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "gutterTop": "<string>",
        "gutterRight": "<string>",
        "gutterBottom": "<string>",
        "gutterLeft": "<string>"
      },
      "container": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "padding": "<string>",
        "borderRadius": "<string>"
      },
      "header": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "padding": "<string>",
        "borderRadius": "<string>"
      },
      "body": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "padding": "<string>",
        "borderRadius": "<string>"
      }
    },
    "bordersAndDividers": {
      "color": "<string>"
    }
  },
  "custom": {
    "headings": {
      "color": "<string>"
    },
    "links": {
      "color": "<string>"
    },
    "menus": {
      "hoverOrFocus": {
        "backgroundColor": "<string>"
      },
      "color": "<string>"
    },
    "header": {
      "backgroundColor": "<string>",
      "button": {
        "backgroundColor": "<string>",
        "color": "<string>"
      },
      "primaryNavigation": {
        "color": "<string>",
        "hoverOrFocus": {
          "backgroundColor": "<string>",
          "color": "<string>"
        }
      },
      "secondaryNavigation": {
        "color": "<string>",
        "hoverOrFocus": {
          "backgroundColor": "<string>",
          "color": "<string>"
        }
      },
      "search": {
        "backgroundColor": "<string>",
        "color": "<string>"
      }
    },
    "content": {
      "screen": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "gutterTop": "<string>",
        "gutterRight": "<string>",
        "gutterBottom": "<string>",
        "gutterLeft": "<string>"
      },
      "container": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "padding": "<string>",
        "borderRadius": "<string>"
      },
      "header": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "padding": "<string>",
        "borderRadius": "<string>"
      },
      "body": {
        "background": "<string>",
        "backgroundColor": "<string>",
        "backgroundImage": "<string>",
        "backgroundSize": "<string>",
        "padding": "<string>",
        "borderRadius": "<string>"
      }
    },
    "bordersAndDividers": {
      "color": "<string>"
    }
  }
}'

Responses

Returned if the look and feel settings were set.

Content typeValue
application/json

LookAndFeelSettings

Get system info

GET /wiki/rest/api/settings/systemInfo

Returns the system information for the Confluence Cloud tenant. This information is used by Atlassian.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

There are no parameters for this request.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/systemInfo' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the system information for the Confluence Cloud tenant is returned.

Content typeValue
application/json

SystemInfoEntity

Get themes

GET /wiki/rest/api/settings/theme

Returns all themes, not including the default theme.

Permissions required: None

App scope requiredREAD

Request

Query parameters
start

integer

The starting index of the returned themes.

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

integer

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

Default: 100, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/theme' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested themes are returned.

Content typeValue
application/json

ThemeArray

Get global theme

GET /wiki/rest/api/settings/theme/selected

Returns the globally assigned theme.

Permissions required: None

App scope requiredREAD

Request

There are no parameters for this request.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/theme/selected' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the global theme is returned.

Content typeValue
application/json

allOf [ThemeNoLinks, object]

Get theme

GET /wiki/rest/api/settings/theme/{themeKey}

Returns a theme. This includes information about the theme name, description, and icon.

Permissions required: None

App scope requiredREAD

Request

Path parameters
themeKey Required

string

The key of the theme to be returned.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/theme/{themeKey}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested theme is returned.

Content typeValue
application/json

allOf [ThemeNoLinks, object]

Space

Get spaces

GET /wiki/rest/api/space

Returns all spaces. The returned spaces are ordered alphabetically in ascending order by space key.

Permissions required: Permission to access the Confluence site ('Can use' global permission). Note, the returned list will only contain spaces that the current user has permission to view.

App scope requiredREAD

Request

Query parameters
spaceKey

Array<string>

The key of the space to be returned. To return multiple spaces, specify this parameter multiple times with different values.

type

string

Filter the results to spaces based on their type.

Valid values: global, personal

status

string

Filter the results to spaces based on their status.

Valid values: current, archived

label

Array<string>

Filter the results to spaces based on their label.

favourite

boolean

Filter the results to the favourite spaces of the user specified by favouriteUserKey. Note, 'favourite' spaces are also known as 'saved for later' spaces.

favouriteUserKey

string

The userKey of the user, whose favourite spaces are used to filter the results when using the favourite parameter.

Leave blank for the current user. Use Get user to get the userKey for a user.

expand

Array<string>

A multi-value parameter indicating which properties of the spaces to expand, where:

  • settings returns the settings for the space, similar to Get space settings.
  • metadata.labels returns the space labels, which are used to categorize the space.
  • operations returns the operations for a space, which are used when setting permissions.
  • lookAndFeel returns information about the look and feel of the space, like the color scheme.
  • permissions returns the permissions for the space.
  • icon returns information about space icon.
  • description.plain returns the description of the space.
  • description.view returns the description of the space.
  • theme returns information about the space theme.
  • homepage returns information about the space homepage.
Style: form
start

integer

The starting index of the returned spaces.

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

integer

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

Default: 25, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested spaces are returned.

Content typeValue
application/json

SpaceArray

Create space

POST /wiki/rest/api/space

Creates a new space. Note, currently you cannot set space labels when creating a space.

Permissions required: 'Create Space(s)' global permission.

App scope requiredWRITE

Request

Body parameters

This is the request object used when creating a new space.

key Required

string

The key for the new space. Format: See Space keys.

name Required

string

The name of the new space.

Max length: 200
description

SpaceDescriptionCreate

The description of the new/updated space. Note, only the 'plain' representation can be used for the description when creating or updating a space.

permissions

Array<SpacePermission>

The permissions for the new space. If no permissions are provided, the Confluence default space permissions are applied. Note, for security reasons, permissions cannot be changed via the API after the space has been created, and must be changed via the user interface instead.

Example

Copy
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "name": "<string>",
  "description": {
    "plain": {
      "value": "<string>",
      "representation": "<string>"
    }
  },
  "permissions": [
    {
      "subjects": {
        "user": {
          "results": [
            {
              "type": "known",
              "username": "<string>",
              "userKey": "<string>",
              "accountId": "<string>",
              "profilePicture": {
                "path": "<string>",
                "width": 2154,
                "height": 2154,
                "isDefault": true
              },
              "displayName": "<string>",
              "operations": [
                {
                  "operation": "administer",
                  "targetType": "page"
                }
              ],
              "details": {},
              "personalSpace": {
                "id": 2154,
                "key": "<string>",
                "name": "<string>",
                "type": "<string>",
                "status": "<string>",
                "_expandable": {},
                "_links": {}
              },
              "_expandable": {
                "operations": "<string>",
                "details": "<string>",
                "personalSpace": "<string>"
              },
              "_links": {}
            }
          ],
          "size": 2154
        },
        "group": {
          "results": [
            {
              "type": "group",
              "name": "<string>",
              "_links": {}
            }
          ],
          "size": 2154
        },
        "_expandable": {
          "user": "<string>",
          "group": "<string>"
        }
      },
      "operation": {
        "operation": "administer",
        "targetType": "page"
      },
      "anonymousAccess": true,
      "unlicensedAccess": true
    }
  ]
}'

Responses

Returned if the space is created.

Content typeValue
application/json

Space

Create private space

POST /wiki/rest/api/space/_private

Creates a new space that is only visible to the creator. This method is the same as the Create space method with permissions set to the current user only. Note, currently you cannot set space labels when creating a space.

Permissions required: 'Create Space(s)' global permission.

App scope requiredWRITE

Request

Body parameters

This is the request object used when creating a new private space.

key Required

string

The key for the new space. Format: See Space keys.

name Required

string

The name of the new space.

Max length: 200
description

SpaceDescriptionCreate

The description of the new/updated space. Note, only the 'plain' representation can be used for the description when creating or updating a space.

Example

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/_private' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "name": "<string>",
  "description": {
    "plain": {
      "value": "<string>",
      "representation": "<string>"
    }
  }
}'

Responses

Returned if the space is created.

Content typeValue
application/json

Space

Get space

GET /wiki/rest/api/space/{spaceKey}

Returns a space. This includes information like the name, description, and permissions, but not the content in the space.

Permissions required: 'View' permission for the space.

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

The key of the space to be returned.

Query parameters
expand

Array<string>

A multi-value parameter indicating which properties of the space to expand, where:

  • settings returns the settings for the space, similar to Get space settings.
  • metadata.labels returns the space labels, which are used to categorize the space.
  • operations returns the operations for a space, which are used when setting permissions.
  • lookAndFeel returns information about the look and feel of the space, like the color scheme.
  • permissions returns the permissions for the space.
  • icon returns information about space icon.
  • description.plain returns the description of the space.
  • description.view returns the description of the space.
  • theme returns information about the space theme.
  • homepage returns information about the space homepage.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested space is returned.

Content typeValue
application/json

Space

Update space

PUT /wiki/rest/api/space/{spaceKey}

Updates the name, description, or homepage of a space.

  • For security reasons, permissions cannot be updated via the API and must be changed via the user interface instead.
  • Currently you cannot set space labels when updating a space.

Permissions required: 'Admin' permission for the space.

App scope requiredWRITE

Request

Path parameters
spaceKey Required

string

The key of the space to update.

Body parameters
name

string

The name of the space.

Max length: 200
description

SpaceDescriptionCreate

The description of the new/updated space. Note, only the 'plain' representation can be used for the description when creating or updating a space.

homepage

object

The page to set as the homepage of the space.

Example

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "description": {
    "plain": {
      "value": "<string>",
      "representation": "<string>"
    }
  },
  "homepage": {
    "id": "<string>"
  }
}'

Responses

Returned if the space is updated.

Content typeValue
application/json

Space

Delete space

DELETE /wiki/rest/api/space/{spaceKey}

Deletes a space. Note, the space will be deleted in a long running task. Therefore, the space may not be deleted yet when this method has returned. Clients should poll the status link that is returned in the response until the task completes.

Permissions required: 'Admin' permission for the space.

App scope requiredDELETE

Request

Path parameters
spaceKey Required

string

The key of the space to delete.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}' \
  --user 'email@example.com:<api_token>'

Responses

Returns a pointer to the status of the space deletion task.

A schema has not been defined for this response code.

Get content for space

GET /wiki/rest/api/space/{spaceKey}/content

Returns all content in a space. The returned content is grouped by type (pages then blogposts), then ordered by content ID in ascending order.

Permissions required: 'View' permission for the space. Note, the returned list will only contain content that the current user has permission to view.

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

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

Query parameters
depth

string

Filter the results to content at the root level of the space or all content.

Default: all

Valid values: all, root

expand

Array<string>

A multi-value parameter indicating which properties of the content to expand, where:

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

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/content' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested content is returned.

Content typeValue
application/json

ContentArray

Get content by type for space

GET /wiki/rest/api/space/{spaceKey}/content/{type}

Returns all content of a given type, in a space. The returned content is ordered by content ID in ascending order.

Permissions required: 'View' permission for the space. Note, the returned list will only contain content that the current user has permission to view.

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

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

type Required

string

The type of content to return.

Valid values: page, blogpost

Query parameters
depth

string

Filter the results to content at the root level of the space or all content.

Default: all

Valid values: all, root

expand

Array<string>

A multi-value parameter indicating which properties of the content to expand, where:

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

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/content/{type}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested content is returned.

Content typeValue
application/json

ContentArray

Get space properties

GET /wiki/rest/api/space/{spaceKey}/property

Returns all properties for the given space. Space properties are a key-value storage associated with a space.

Permissions required: ‘View’ permission for the space.

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

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

Query parameters
expand

Array<string>

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

  • version returns information about the version of the content.
  • space returns the space that the properties are in.
Style: form
start

integer

The starting index of the returned objects.

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

integer

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

Default: 10, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/property' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested space properties are returned.

Content typeValue
application/json

SpacePropertyArray

Create space property

POST /wiki/rest/api/space/{spaceKey}/property

Creates a new space property.

Permissions required: ‘Admin’ permission for the space.

App scope requiredWRITE

Request

Path parameters
spaceKey Required

string

The key of the space that the property will be created in.

Body parameters
key Required

string

The key of the new property.

Maximum: 255
value Required

PropertyValue

The value of the property. This can be empty or a complex object. For example,

Copy
1
2
3
4
5
"value": {
  "example1": "value",
  "example2": true,
  "example3": 123
}

Example

Copy
1
2
3
4
5
6
7
8
9
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/property' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "value": {}
}'

Responses

Returned if the space property is created.

Content typeValue
application/json

SpaceProperty

Get space property

GET /wiki/rest/api/space/{spaceKey}/property/{key}

Returns a space property.

Permissions required: ‘View’ permission for the space.

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

The key of the space that the property is in.

key Required

string

The key of the space property.

Query parameters
expand

Array<string>

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

  • version returns information about the version of the content.
  • space returns the space that the properties are in.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/property/{key}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested space property is returned.

Content typeValue
application/json

SpaceProperty

Update space property

PUT /wiki/rest/api/space/{spaceKey}/property/{key}

Updates a space property. Note, you cannot update the key of a space property, only the value.

Permissions required: ‘Admin’ permission for the space.

App scope requiredWRITE

Request

Path parameters
spaceKey Required

string

The key of the space that the property is in.

key Required

string

The key of the property to be updated.

Body parameters
value Required

object

The value of the property.

version Required

object

The version number of the property.

Example

Copy
1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/property/{key}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "value": {},
  "version": {
    "number": 197,
    "minorEdit": true
  }
}'

Responses

Returned if the space property is updated.

Content typeValue
application/json

SpaceProperty

Create space property for key

POST /wiki/rest/api/space/{spaceKey}/property/{key}

Creates a new space property. This is the same as POST /space/{spaceKey}/property but the key for the property is passed as a path parameter, rather than in the request body.

Permissions required: ‘Admin’ permission for the space.

App scope requiredWRITE

Request

Path parameters
spaceKey Required

string

The key of the space that the property will be created in.

key Required

string

The key of the property to be created.

Body parameters
value Required

PropertyValue

The value of the property. This can be empty or a complex object. For example,

Copy
1
2
3
4
5
"value": {
  "example1": "value",
  "example2": true,
  "example3": 123
}

Example

Copy
1
2
3
4
5
6
7
8
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/property/{key}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "value": {}
}'

Responses

Returned if the space property is created.

Content typeValue
application/json

SpaceProperty

Delete space property

DELETE /wiki/rest/api/space/{spaceKey}/property/{key}

Deletes a space property.

Permissions required: ‘Admin’ permission for the space.

App scope requiredDELETE

Request

Path parameters
spaceKey Required

string

The key of the space that the property is in.

key Required

string

The key of the property to be deleted.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/property/{key}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the space property is deleted.

Get space settings

GET /wiki/rest/api/space/{spaceKey}/settings

Returns the settings of a space. Currently only the routeOverrideEnabled setting can be returned.

Permissions required: 'View' permission for the space.

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

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

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/settings' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the space settings are returned.

Content typeValue
application/json

SpaceSettings

Update space settings

PUT /wiki/rest/api/space/{spaceKey}/settings

Updates the settings for a space. Currently only the routeOverrideEnabled setting can be updated.

Permissions required: 'Admin' permission for the space.

App scope requiredWRITE

Request

Path parameters
spaceKey Required

string

The key of the space whose settings will be updated.

Body parameters
routeOverrideEnabled

boolean

Defines whether an override for the space home should be used. This is used in conjunction with a space theme provided by an app. For example, if this property is set to true, a theme can display a page other than the space homepage when users visit the root URL for a space. This property allows apps to provide content-only theming without overriding the space home.

Example

Copy
1
2
3
4
5
6
7
8
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/settings' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "routeOverrideEnabled": true
}'

Responses

Returned if space settings are updated.

Content typeValue
application/json

SpaceSettings

Get space theme

GET /wiki/rest/api/space/{spaceKey}/theme

Returns the theme selected for a space, if one is set. If no space theme is set, this means that the space is inheriting the global look and feel settings.

Permissions required: ‘View’ permission for the space.

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

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

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/theme' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested theme is returned.

Content typeValue
application/json

allOf [ThemeNoLinks, object]

Set space theme

PUT /wiki/rest/api/space/{spaceKey}/theme

Sets the theme for a space. Note, if you want to reset the space theme to the default Confluence theme, use the 'Reset space theme' method instead of this method.

Permissions required: 'Admin' permission for the space.

App scope requiredWRITE

Request

Path parameters
spaceKey Required

string

The key of the space to set the theme for.

Body parameters
themeKey Required

string

The key of the theme to be set as the space theme.

Example

Copy
1
2
3
4
5
6
7
8
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/theme' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "themeKey": "<string>"
}'

Responses

Returned if the theme was set for the space.

Content typeValue
application/json

allOf [ThemeNoLinks, object]

Reset space theme

DELETE /wiki/rest/api/space/{spaceKey}/theme

Resets the space theme. This means that the space will inherit the global look and feel settings

Permissions required: 'Admin' permission for the space.

App scope requiredDELETE

Request

Path parameters
spaceKey Required

string

The key of the space to reset the theme for.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}/theme' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the theme was reset for the space.

Template

Update content template

PUT /wiki/rest/api/template

Updates a content template. Note, blueprint templates cannot be updated via the REST API.

Permissions required: 'Admin' permission for the space to create a space template or 'Confluence Administrator' global permission to create a global template.

App scope requiredWRITE

Request

Body parameters

This object is used to update content templates.

templateId Required

string

The ID of the template being updated.

name Required

string

The name of the template. Set to the current name if this field is not being updated.

templateType Required

string

The type of the template. Set to page.

Valid values: page

body Required

ContentBodyCreate

This object is used when creating or updating content.

description

string

A description of the template.

Max length: 100
labels

Array<Label>

Labels for the template.

space

object

The key for the space of the template. Required if the template is a space template. Set this to the current space.key.

Example

Copy
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/template' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "templateId": "<string>",
  "name": "<string>",
  "templateType": "page",
  "body": {
    "value": "<string>",
    "representation": "view"
  },
  "description": "<string>",
  "labels": [
    {
      "prefix": "<string>",
      "name": "<string>",
      "id": "<string>",
      "label": "<string>"
    }
  ],
  "space": {
    "key": "<string>"
  }
}'

Responses

Returned if the template is updated.

Content typeValue
application/json

ContentTemplate

Create content template

POST /wiki/rest/api/template

Creates a new content template. Note, blueprint templates cannot be created via the REST API.

Permissions required: 'Admin' permission for the space to create a space template or 'Confluence Administrator' global permission to create a global template.

App scope requiredWRITE

Request

Body parameters

This object is used to create content templates.

name Required

string

The name of the new template.

templateType Required

string

The type of the new template. Set to page.

body Required

ContentBodyCreate

This object is used when creating or updating content.

description

string

A description of the new template.

Max length: 255
labels

Array<Label>

Labels for the new template.

space

object

The key for the space of the new template. Only applies to space templates. If the spaceKey is not specified, the template will be created as a global template.

Example

Copy
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
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "templateType": "<string>",
  "body": {
    "value": "<string>",
    "representation": "view"
  },
  "description": "<string>",
  "labels": [
    {
      "prefix": "<string>",
      "name": "<string>",
      "id": "<string>",
      "label": "<string>"
    }
  ],
  "space": {
    "key": "<string>"
  }
}'

Responses

Returned if the template is created.

Content typeValue
application/json

ContentTemplate

Get blueprint templates

GET /wiki/rest/api/template/blueprint

Returns all templates provided by blueprints. Use this method to retrieve all global blueprint templates or all blueprint templates in a space.

Note, all global blueprints are inherited by each space. Space blueprints can be customised without affecting the global blueprints.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Query parameters
spaceKey

string

The key of the space to be queried for templates. If the spaceKey is not specified, global blueprint templates will be returned.

start

integer

The starting index of the returned templates.

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

integer

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

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

Array<string>

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

  • body returns the content of the template in storage format.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/blueprint' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested templates are returned.

Content typeValue
application/json

BlueprintTemplateArray

Get content templates

GET /wiki/rest/api/template/page

Returns all content templates. Use this method to retrieve all global content templates or all content templates in a space.

Permissions required: 'Admin' permission for the space to view space templates and 'Confluence Administrator' global permission to view global templates.

App scope requiredREAD

Request

Query parameters
spaceKey

string

The key of the space to be queried for templates. If the spaceKey is not specified, global templates will be returned.

start

integer

The starting index of the returned templates.

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

integer

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

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

Array<string>

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

  • body returns the content of the template in storage format.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/page' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested templates are returned.

Content typeValue
application/json

ContentTemplateArray

Get content template

GET /wiki/rest/api/template/{contentTemplateId}

Returns a content template. This includes information about template, like the name, the space or blueprint that the template is in, the body of the template, and more.

Permissions required: 'Admin' permission for the space to view space templates and 'Confluence Administrator' global permission to view global templates.

App scope requiredREAD

Request

Path parameters
contentTemplateId Required

string

The ID of the content template to be returned.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/{contentTemplateId}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested template is returned.

Content typeValue
application/json

ContentTemplate

Remove template

DELETE /wiki/rest/api/template/{contentTemplateId}

Deletes a template. This results in different actions depending on the type of template:

  • If the template is a content template, it is deleted.
  • If the template is a modified space-level blueprint template, it reverts to the template inherited from the global-level blueprint template.
  • If the template is a modified global-level blueprint template, it reverts to the default global-level blueprint template.

    Note, unmodified blueprint templates cannot be deleted.

App scope requiredDELETE

Request

Path parameters
contentTemplateId Required

string

The ID of the template to be deleted.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/{contentTemplateId}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the template has been successfully been deleted.

User

Get user

GET /wiki/rest/api/user

Returns a user. This includes information about the user, like the display name, userKey, account ID, profile picture, and more.

The username, key, or accountId parameter must be specified, in order to identify the user.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Query parameters
key

string

The userKey of the user to be returned. Required, unless the username or accountId is specified. The key uniquely identifies a user in a Confluence instance and does not change.

username

string

The username of the user to be returned. Required, unless the key or accountId is specified. The username uniquely identifies a user in a Confluence instance but can change if the user is renamed.

accountId

string

The accountId of the user to be returned. Required, unless the username or key is specified. The accountId uniquely identifies a user across all Atlassian products.

expand

Array<string>

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

  • operations returns the operations that the user is allowed to do.
  • details.personal returns the 'Personal' details in the user's profile, like the 'Email' and 'Phone'.
  • details.business returns the 'Company' details in the user's profile, like the 'Position' and 'Department'.
  • personalSpace returns the user's personal space, if it exists.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested user is returned.

Content typeValue
application/json

User

Get anonymous user

GET /wiki/rest/api/user/anonymous

Returns information about how anonymous users are represented, like the profile picture and display name.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Query parameters
expand

Array<string>

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

  • operations returns the operations that the user is allowed to do.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/anonymous' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the anonymous user representation is returned.

Content typeValue
application/json

UserAnonymous

Get current user

GET /wiki/rest/api/user/current

Returns the currently logged-in user. This includes information about the user, like the display name, userKey, account ID, profile picture, and more.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Query parameters
expand

Array<string>

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

  • operations returns the operations that the user is allowed to do.
  • details.personal returns the 'Personal' details in the user's profile, like the 'Email' and 'Phone'.
  • details.business returns the 'Company' details in the user's profile, like the 'Position' and 'Department'.
  • personalSpace returns the user's personal space, if it exists.
Style: form

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/current' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the current user is returned.

Content typeValue
application/json

User

Get group memberships for user

GET /wiki/rest/api/user/memberof

Returns the groups that a user is a member of.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Query parameters
key

string

The userKey of the user to be queried. Required, unless the username or accountId is specified. The key uniquely identifies a user in a Confluence instance and does not change.

username

string

The username of the user to be queried. Required, unless the key or accountId is specified. The username uniquely identifies a user in a Confluence instance but can change if the user is renamed.

accountId

string

The accountId of the user to be queried. Required, unless the username or key is specified. The accountId uniquely identifies a user across all Atlassian products.

start

integer

The starting index of the returned groups.

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

integer

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

Default: 200, Minimum: 0, Format: int32

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/memberof' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested groups are returned.

Content typeValue
application/json

GroupArray

Get content watch status

GET /wiki/rest/api/user/watch/content/{contentId}

Returns whether a user is watching a piece of content. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Path parameters
contentId Required

string

The ID of the content to be queried for whether the specified user is watching it.

Query parameters
key

string

The key of the user to be queried for whether they are watching the content. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user to be queried for whether they are watching the content. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user to be queried for whether they are watching the content. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/content/{contentId}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested watch status is returned.

Content typeValue
application/json

UserWatch

Add content watcher

POST /wiki/rest/api/user/watch/content/{contentId}

Adds a user as a watcher to a piece of content. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Note, you must add the X-Atlassian-Token: no-check header when making a request, as this operation has XSRF protection.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

Apps cannot access this REST resource.

Request

Path parameters
contentId Required

string

The ID of the content to add the watcher to.

Query parameters
key

string

The key of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/content/{contentId}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the watcher was successfully created. No response body is returned.

Remove content watcher

DELETE /wiki/rest/api/user/watch/content/{contentId}

Removes a user as a watcher from a piece of content. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

Apps cannot access this REST resource.

Request

Path parameters
contentId Required

string

The ID of the content to remove the watcher from.

Query parameters
key

string

The key of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/content/{contentId}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the watcher was successfully deleted. No response body is returned.

Get label watch status

GET /wiki/rest/api/user/watch/label/{labelName}

Returns whether a user is watching a label. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Path parameters
labelName Required

string

The name of the label to be queried for whether the specified user is watching it.

Query parameters
key

string

The key of the user to be queried for whether they are watching the label. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user to be queried for whether they are watching the label. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user to be queried for whether they are watching the label. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/label/{labelName}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested watch status is returned.

Content typeValue
application/json

UserWatch

Add label watcher

POST /wiki/rest/api/user/watch/label/{labelName}

Adds a user as a watcher to a label. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Note, you must add the X-Atlassian-Token: no-check header when making a request, as this operation has XSRF protection.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

Apps cannot access this REST resource.

Request

Path parameters
labelName Required

string

The name of the label to add the watcher to.

Query parameters
key

string

The key of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/label/{labelName}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the watcher was successfully created. No response body is returned.

Remove label watcher

DELETE /wiki/rest/api/user/watch/label/{labelName}

Removes a user as a watcher from a label. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

Apps cannot access this REST resource.

Request

Path parameters
labelName Required

string

The name of the label to remove the watcher from.

Query parameters
key

string

The key of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/label/{labelName}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the watcher was successfully deleted. No response body is returned.

Get space watch status

GET /wiki/rest/api/user/watch/space/{spaceKey}

Returns whether a user is watching a space. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

App scope requiredREAD

Request

Path parameters
spaceKey Required

string

The key of the space to be queried for whether the specified user is watching it.

Query parameters
key

string

The key of the user to be queried for whether they are watching the space. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user to be queried for whether they are watching the space. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user to be queried for whether they are watching the space. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/space/{spaceKey}' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested watch status is returned.

Content typeValue
application/json

UserWatch

Add space watcher

POST /wiki/rest/api/user/watch/space/{spaceKey}

Adds a user as a watcher to a space. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Note, you must add the X-Atlassian-Token: no-check header when making a request, as this operation has XSRF protection.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

Apps cannot access this REST resource.

Request

Path parameters
spaceKey Required

string

The key of the space to add the watcher to.

Query parameters
key

string

The key of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user that will be added as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/space/{spaceKey}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the watcher was successfully created. No response body is returned.

Remove space watch

DELETE /wiki/rest/api/user/watch/space/{spaceKey}

Removes a user as a watcher from a space. Choose the user by doing one of the following:

  • Specify a user via a query parameter: Use the username, key, or accountId to identify the user. The user making the request must be a Confluence administrator.
  • Do not specify a user: The currently logged-in user will be used.

Permissions required: 'Confluence Administrator' global permission if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).

Apps cannot access this REST resource.

Request

Path parameters
spaceKey Required

string

The key of the space to remove the watcher from.

Query parameters
key

string

The key of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

username

string

The username of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

accountId

string

The accountId of the user that will be removed as a watcher. Only one of username, key, accountId can be used to identify the user in the request.

Example

Copy
1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/user/watch/space/{spaceKey}' \
  --user 'email@example.com:<api_token>'

Responses

Returned if the watcher was successfully deleted. No response body is returned.