GET

Get content

Returns a paginated list of Content. Example request URI(s):

  • http://example.com/confluence/rest/api/content?spaceKey=TST&title=Cheese&expand=space,body.view,version,container
  • http://example.com/confluence/rest/api/content?type=blogpost&spaceKey=TST&title=Bacon&postingDay=2014-02-13&expand=space,body.view,version,container

Request

Query parameters

spaceKey

string

expand

string

limit

string

start

string

postingDay

string

ids

string

title

string

type

string

status

string

Responses

Returns a full JSON representation of a list of content.

application/json

object
GET/rest/api/content
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 { "results": [ { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": {}, "description": {}, "homepage": {}, "links": {}, "type": "global", "creator": {}, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": {}, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": {}, "permissions": {} }, "history": { "previousVersion": {}, "nextVersion": {}, "lastUpdated": {}, "latest": true, "createdBy": {}, "createdDate": "2020-01-01T00:00:00Z", "contributors": {}, "contentParentRef": {}, "lastUpdatedRef": {}, "nextVersionRef": {}, "previousVersionRef": {} }, "version": { "by": {}, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": {}, "contentRef": {} }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } } ], "totalCount": 2154, "start": 25, "limit": 25, "size": 25, "_links": { "base": "http://localhost:8085/confluence", "context": "confluence", "self": "http://localhost:8085/rest/api/latest/..?limit=25&start=25", "next": "http://localhost:8085/rest/api/latest/..?limit=25&start=50", "prev": "http://localhost:8085/rest/api/latest/..?limit=25&start=0" } }
POST

Create content

Creates a new piece of Content or publishes the draft if the content id is present. For the case publishing draft, a new piece of content will be created and all metadata from the draft will be transferred into the newly created content.

Request

Query parameters

expand

string

status

string

Request bodyapplication/json

new content to be created.

id

string

type

string

status

string

title

string

links

object

space

Space

history

History

version

Version

ancestors

array<Content>

position

integer

Responses

returns a JSON representation of the content.

application/json

Content
POST/rest/api/content
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 curl --request POST \ --url 'http://{baseurl}/confluence/rest/api/content' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": { "idProperties": {}, "expanded": true }, "description": {}, "homepage": { "idProperties": {}, "expanded": true }, "links": {}, "type": "global", "creator": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": { "idProperties": {}, "expanded": true }, "permissions": { "idProperties": {}, "expanded": true } }, "history": { "previousVersion": { "idProperties": {}, "expanded": true }, "nextVersion": { "idProperties": {}, "expanded": true }, "lastUpdated": { "idProperties": {}, "expanded": true }, "latest": true, "createdBy": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "createdDate": "2020-01-01T00:00:00Z", "contributors": { "idProperties": {}, "expanded": true }, "contentParentRef": { "idProperties": {}, "expanded": true }, "lastUpdatedRef": { "idProperties": {}, "expanded": true }, "nextVersionRef": { "idProperties": {}, "expanded": true }, "previousVersionRef": { "idProperties": {}, "expanded": true } }, "version": { "by": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": { "idProperties": {}, "expanded": true }, "contentRef": { "idProperties": {}, "expanded": true } }, "ancestors": [ { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": {}, "description": {}, "homepage": {}, "links": {}, "type": "global", "creator": {}, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": {}, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": {}, "permissions": {} }, "history": { "previousVersion": {}, "nextVersion": {}, "lastUpdated": {}, "latest": true, "createdBy": {}, "createdDate": "2020-01-01T00:00:00Z", "contributors": {}, "contentParentRef": {}, "lastUpdatedRef": {}, "nextVersionRef": {}, "previousVersionRef": {} }, "version": { "by": {}, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": {}, "contentRef": {} }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } } ], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": { "idProperties": {}, "expanded": true }, "description": {}, "homepage": { "idProperties": {}, "expanded": true }, "links": {}, "type": "global", "creator": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": { "idProperties": {}, "expanded": true }, "permissions": { "idProperties": {}, "expanded": true } }, "history": { "previousVersion": { "idProperties": {}, "expanded": true }, "nextVersion": { "idProperties": {}, "expanded": true }, "lastUpdated": { "idProperties": {}, "expanded": true }, "latest": true, "createdBy": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "createdDate": "2020-01-01T00:00:00Z", "contributors": { "idProperties": {}, "expanded": true }, "contentParentRef": { "idProperties": {}, "expanded": true }, "lastUpdatedRef": { "idProperties": {}, "expanded": true }, "nextVersionRef": { "idProperties": {}, "expanded": true }, "previousVersionRef": { "idProperties": {}, "expanded": true } }, "version": { "by": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": { "idProperties": {}, "expanded": true }, "contentRef": { "idProperties": {}, "expanded": true } }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } }
GET

Get content by ID

Returns a piece of Content. Example request URI(s):

  • http://example.com/confluence/rest/api/content/1234?expand=space,body.view,version,container
  • http://example.com/confluence/rest/api/content/1234?status=any

Request

Path parameters

id

string

Required

Query parameters

expand

string

version

string

status

string

Responses

returns a JSON representation of the content, or a 404 NOT FOUND if there is no content with the given id or if the user is not permitted.

application/json

Content
GET/rest/api/content/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": { "idProperties": {}, "expanded": true }, "description": {}, "homepage": { "idProperties": {}, "expanded": true }, "links": {}, "type": "global", "creator": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": { "idProperties": {}, "expanded": true }, "permissions": { "idProperties": {}, "expanded": true } }, "history": { "previousVersion": { "idProperties": {}, "expanded": true }, "nextVersion": { "idProperties": {}, "expanded": true }, "lastUpdated": { "idProperties": {}, "expanded": true }, "latest": true, "createdBy": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "createdDate": "2020-01-01T00:00:00Z", "contributors": { "idProperties": {}, "expanded": true }, "contentParentRef": { "idProperties": {}, "expanded": true }, "lastUpdatedRef": { "idProperties": {}, "expanded": true }, "nextVersionRef": { "idProperties": {}, "expanded": true }, "previousVersionRef": { "idProperties": {}, "expanded": true } }, "version": { "by": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": { "idProperties": {}, "expanded": true }, "contentRef": { "idProperties": {}, "expanded": true } }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } }
DEL

Delete content

Trashes or purges a piece of Content, based on its ContentType and ContentStatus.

There are three cases:

  • If the content is trashable and its status is current, it will be trashed.

  • If the content is trashable, its status is trashed and the status query parameter in the request is trashed, the content will be purged from the trash and deleted permanently.

  • If the content is not trashable it will be deleted permanently without being trashed.

Request

Path parameters

id

string

Required

Query parameters

status

string

Responses

Returned if successfully trashed.

application/json

any

DEL/rest/api/content/{id}
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/confluence/rest/api/content/{id}' \ --header 'Accept: application/json'
GET

Get history of content

Returns the history of a particular piece of content. Example request URI(s):

  • http://example.com/confluence/rest/api/content/1234/history
  • http://example.com/confluence/rest/api/content/1234/history?expand=previousVersion,nextVersion,lastUpdated
  • http://example.com/confluence/rest/api/content/1234/history?cql=creator=currentUser()&cqlcontext={"spaceKey":"TST", "contentId":"55"}&expand=previousVersion,nextVersion,lastUpdated
  • http://example.com/confluence/rest/api/content/1234/history?cql=creator=currentUser()&cqlcontext={"spaceKey":"TST", "contentId":"55"}&expand=previousVersion,nextVersion,lastUpdated&start=0&limit=10

Request

Path parameters

id

string

Required

Query parameters

expand

string

Responses

Returns a full JSON representation of the content's history

application/json

History
GET/rest/api/content/{id}/history
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/history' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 { "previousVersion": { "idProperties": {}, "expanded": true }, "nextVersion": { "idProperties": {}, "expanded": true }, "lastUpdated": { "idProperties": {}, "expanded": true }, "latest": true, "createdBy": { "profilePicture": { "path": "http://www.example.com/path/to/image.png", "width": 16, "height": 16, "isDefault": true }, "displayName": "Joe Smith", "type": "<string>" }, "createdDate": "2020-01-01T00:00:00Z", "contributors": { "idProperties": {}, "expanded": true }, "contentParentRef": { "idProperties": {}, "expanded": true }, "lastUpdatedRef": { "idProperties": {}, "expanded": true }, "nextVersionRef": { "idProperties": {}, "expanded": true }, "previousVersionRef": { "idProperties": {}, "expanded": true } }
GET

Get macro body by hashDeprecated

Returns the body of a macro (in storage format) with the given hash. This resource is primarily used by connect applications that require the body of macro to perform their work.

The hash is generated by connect during render time of the local macro holder and is usually only relevant during the scope of one request. For optimisation purposes, this hash will usually live for multiple requests.

Collecting a macro by its hash should now be considered deprecated and will be replaced, transparently with macroIds. This resource is currently only called from connect addons which will eventually all use the getContentById resource.

To make the migration as seamless as possible, this resource will match macros against a generated hash or a stored macroId. This will allow add ons to work during the migration period.

Request

Path parameters

id

string

Required
version

string

Required
hash

string

Required

Responses

Returns a json representation of a macro.

application/json

MacroInstance
GET/rest/api/content/{id}/history/{version}/macro/hash/{hash}
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/history/{version}/macro/hash/{hash}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "name": "panel", "body": "This is the body of the panel macro.", "parameters": {} }
GET

Get macro body by macro ID

Returns the body of a macro (in storage format) with the given id. This resource is primarily used by connect applications that require the body of macro to perform their work.

When content is created, if no macroId is specified, then Confluence will generate a random id. The id is persisted as the content is saved and only modified by Confluence if there are conflicting IDs.

To preserve backwards compatibility this resource will also match on the hash of the macro body, even if a macroId is found. This check will become redundant as pages get macroId's generated for them and transparently propagate out to all instances.

Request

Path parameters

macroId

string

Required
id

string

Required
version

string

Required

Responses

Returns a json representation of a macro.

application/json

MacroInstance
GET/rest/api/content/{id}/history/{version}/macro/id/{macroId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/history/{version}/macro/id/{macroId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "name": "panel", "body": "This is the body of the panel macro.", "parameters": {} }
GET

Scan content by space key

Returns a paginated list of Content. Example request URI(s):

  • http://example.com/confluence/rest/api/content/scan?spaceKey=TST&limit=100&expand=space,body.view,version,container
  • http://example.com/confluence/rest/api/content/scan?limit=100&expand=space,body.view,version,container

Request

Query parameters

cursor

string

spaceKey

string

expand

string

limit

string

type

string

status

string

Responses

returns a JSON representation of the list of content.

application/json

object
GET/rest/api/content/scan
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/scan' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 { "results": [ { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": {}, "description": {}, "homepage": {}, "links": {}, "type": "global", "creator": {}, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": {}, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": {}, "permissions": {} }, "history": { "previousVersion": {}, "nextVersion": {}, "lastUpdated": {}, "latest": true, "createdBy": {}, "createdDate": "2020-01-01T00:00:00Z", "contributors": {}, "contentParentRef": {}, "lastUpdatedRef": {}, "nextVersionRef": {}, "previousVersionRef": {} }, "version": { "by": {}, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": {}, "contentRef": {} }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } } ], "nextCursor": "cursortype:false:360456", "prevCursor": "cursortype:true:360423", "totalCount": 2154, "cursor": "cursortype:false:360422", "limit": 25, "size": 25, "_links": { "base": "http://localhost:8085/confluence", "context": "confluence", "self": "http://localhost:8085/confluence/rest/api/..?limit=25", "next": "http://localhost:8085/confluence/rest/api/latest/..?limit=25&cursor=cursortype%3Afalse%3A360456", "prev": "http://localhost:8085/confluence/rest/api/latest/..?limit=25&cursor=cursortype%3Atrue%3A360423" } }
GET

Search content using CQL

Fetch a list of content using the Confluence Query Language (CQL). See: Advanced searching using CQL

Example request URI(s):

  • http://localhost:8080/confluence/rest/api/content/search?cql=creator=currentUser()&cqlcontext={"spaceKey":"TST", "contentId":"55"}
  • http://localhost:8080/confluence/rest/api/content/search?cql=space=DEV AND label=docs&expand=space,metadata.labels&limit=10

Request

Query parameters

cqlcontext

string

expand

string

limit

string

start

string

cql

string

Responses

returns a paginated list of content.

application/json

object
GET/rest/api/content/search
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/search' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 { "results": [ { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": {}, "description": {}, "homepage": {}, "links": {}, "type": "global", "creator": {}, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": {}, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": {}, "permissions": {} }, "history": { "previousVersion": {}, "nextVersion": {}, "lastUpdated": {}, "latest": true, "createdBy": {}, "createdDate": "2020-01-01T00:00:00Z", "contributors": {}, "contentParentRef": {}, "lastUpdatedRef": {}, "nextVersionRef": {}, "previousVersionRef": {} }, "version": { "by": {}, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": {}, "contentRef": {} }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } } ], "totalCount": 2154, "start": 25, "limit": 25, "size": 25, "_links": { "base": "http://localhost:8085/confluence", "context": "confluence", "self": "http://localhost:8085/rest/api/latest/..?limit=25&start=25", "next": "http://localhost:8085/rest/api/latest/..?limit=25&start=50", "prev": "http://localhost:8085/rest/api/latest/..?limit=25&start=0" } }
PUT

Update content

Updates a piece of Content, including changes to content status.

To update a piece of content you must increment the version.number, supplying the number of the version you are creating. The title property can be updated on all content, body can be updated on all content that has a body (not attachments). For instance to update the content of a blogpost that currently has version 1:

PUT /rest/api/content/456

1 2 3 4 5 6 7 8 9 10 11 12 13 { "version":{ "number": 2 }, "title":"My new title", "type":"page", "body":{ "storage":{ "value":"<p>New page data.</p>", "representation":"storage" } } }

To update a page and change its parent page, supply the ancestors property with the request with the parent as the first ancestor i.e. to move a page to be a child of page with ID 789:

PUT /rest/api/content/456

1 2 3 4 5 6 7 8 9 10 11 12 13 { "version":{ "number": 2 }, "ancestors": [{"id":789}], "type":"page", "body":{ "storage":{ "value":"<p>New page data.</p>", "representation":"storage" } } }

Changing status

To restore a piece of content that has the status of trashed the content must have it's version incremented, and status set to current. No other field modifications will be performed when restoring a piece of content from the trash.

Request example to restore from trash: {"id": "557059","status": "current","version": {"number": 2}}

If the content you're updating has a draft, specifying status=draft will delete that draft and the body of the content will be replaced with the body specified in the request.

Request example to delete a draft:

PUT: http://localhost:9096/confluence/rest/api/content/2149384202?status=draft

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "id":"2149384202", "status":"current", "version":{ "number":4 }, "space":{ "key":"TST" }, "type":"page", "title":"page title", "body":{ "storage":{ "value":"<p>New page data.</p>", "representation":"storage" } } }

Changing page position

To set page position, supply the position property in the request body with a positive integer. Content with unset positions will have a position value of -1. To unset a content position, supply position property with -1.

Request example to set page position to 1

PUT /rest/api/content/2149384202

1 2 3 4 5 6 7 8 9 { "id":"2149384202", "version":{ "number":2 }, "type":"page", "title":"page title", "position":1 }

Request example to unset page position

PUT /rest/api/content/2149384202

1 2 3 4 5 6 7 8 { "id":"2149384202", "version":{ "number":2 }, "type":"page", "position":-1 }

Request

Path parameters

contentId

string

Required

Query parameters

asyncReconciliation

boolean

conflictPolicy

string

status

string

Request bodyapplication/json

new content to be created.

id

string

type

string

status

string

title

string

links

object

space

Space

history

History

version

Version

ancestors

array<Content>

position

integer

Responses

Returns a full JSON representation of a piece of content.

application/json

Content
PUT/rest/api/content/{contentId}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 curl --request PUT \ --url 'http://{baseurl}/confluence/rest/api/content/{contentId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": { "idProperties": {}, "expanded": true }, "description": {}, "homepage": { "idProperties": {}, "expanded": true }, "links": {}, "type": "global", "creator": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": { "idProperties": {}, "expanded": true }, "permissions": { "idProperties": {}, "expanded": true } }, "history": { "previousVersion": { "idProperties": {}, "expanded": true }, "nextVersion": { "idProperties": {}, "expanded": true }, "lastUpdated": { "idProperties": {}, "expanded": true }, "latest": true, "createdBy": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "createdDate": "2020-01-01T00:00:00Z", "contributors": { "idProperties": {}, "expanded": true }, "contentParentRef": { "idProperties": {}, "expanded": true }, "lastUpdatedRef": { "idProperties": {}, "expanded": true }, "nextVersionRef": { "idProperties": {}, "expanded": true }, "previousVersionRef": { "idProperties": {}, "expanded": true } }, "version": { "by": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": { "idProperties": {}, "expanded": true }, "contentRef": { "idProperties": {}, "expanded": true } }, "ancestors": [ { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": {}, "description": {}, "homepage": {}, "links": {}, "type": "global", "creator": {}, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": {}, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": {}, "permissions": {} }, "history": { "previousVersion": {}, "nextVersion": {}, "lastUpdated": {}, "latest": true, "createdBy": {}, "createdDate": "2020-01-01T00:00:00Z", "contributors": {}, "contentParentRef": {}, "lastUpdatedRef": {}, "nextVersionRef": {}, "previousVersionRef": {} }, "version": { "by": {}, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": {}, "contentRef": {} }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } } ], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 { "id": "123456", "type": "page", "status": "current", "title": "My Page", "links": {}, "space": { "id": 123456, "key": "TEST", "name": "Test Space", "status": "current", "icon": { "idProperties": {}, "expanded": true }, "description": {}, "homepage": { "idProperties": {}, "expanded": true }, "links": {}, "type": "global", "creator": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "creationDate": "2024-01-01T00:00:00Z", "lastModifier": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "lastModificationDate": "2024-01-01T00:00:00Z", "metadata": { "labels": [ "label1", "label2" ] }, "retentionPolicy": { "idProperties": {}, "expanded": true }, "permissions": { "idProperties": {}, "expanded": true } }, "history": { "previousVersion": { "idProperties": {}, "expanded": true }, "nextVersion": { "idProperties": {}, "expanded": true }, "lastUpdated": { "idProperties": {}, "expanded": true }, "latest": true, "createdBy": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "createdDate": "2020-01-01T00:00:00Z", "contributors": { "idProperties": {}, "expanded": true }, "contentParentRef": { "idProperties": {}, "expanded": true }, "lastUpdatedRef": { "idProperties": {}, "expanded": true }, "nextVersionRef": { "idProperties": {}, "expanded": true }, "previousVersionRef": { "idProperties": {}, "expanded": true } }, "version": { "by": { "profilePicture": {}, "displayName": "Joe Smith", "type": "<string>" }, "when": "2020-01-01T00:00:00Z", "message": "A message", "number": 1, "minorEdit": true, "hidden": true, "syncRev": "123456", "content": { "idProperties": {}, "expanded": true }, "contentRef": { "idProperties": {}, "expanded": true } }, "ancestors": [], "position": 1, "operations": [ { "operation": "read", "targetType": "page" } ], "children": {}, "descendants": {}, "body": {}, "metadata": { "key": "value" }, "extensions": { "key": "value" }, "restrictions": { "use": { "operation": "use", "restrictions": [] } }, "relevantViewRestrictions": { "idProperties": {}, "expanded": true }, "versionRef": { "idProperties": {}, "expanded": true }, "containerRef": { "idProperties": {}, "expanded": true }, "historyRef": { "idProperties": {}, "expanded": true }, "spaceRef": { "idProperties": {}, "expanded": true } }

Rate this page: