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:

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:

1
GET /wiki/rest/api/content/{id}?expand=space,metadata.labels

Pagination: The Confluence REST API uses pagination: a method that returns a response with multiple objects can only return a limited number at one time. This limits the size of responses and conserves server resources.

Use the 'limit' and 'start' query parameters to specify pagination:

  • limit is the number of objects to return per page. This may be restricted by system limits.
  • start is the index of the first item returned in the page of results. The base index is 0.

For example, the following request will return ten content objects, starting from the fifth object.

1
GET /wiki/rest/api/content?start=4,limit=10

Special headers:

  • X-Atlassian-Token: no-check request header must be specified for methods that are protected from Cross Site Request Forgery (XSRF/CSRF) attacks. This is stated in the method description, if required. For more information, see this KB article.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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.

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

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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,

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

Example

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

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

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,

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

Example

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

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

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

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

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

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

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

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

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

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

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

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