This document describes the REST API and resources provided by Confluence. The REST APIs are for developers who want to integrate Confluence into their application and for administrators who want to script interactions with the Confluence server.
Confluence's REST APIs provide access to resources (data entities) via URI paths. To use a REST API, your application will make an HTTP request and parse the response. The response format is JSON. Your methods will be the standard HTTP methods like GET, PUT, POST and DELETE.
Because the REST API is based on open standards, you can use any web development language to access the API.
URIs for the Confluence REST API resource have the following structure:
With context: http://host:port/context/rest/api/resource-name
Or without context: http://host:port/rest/api/resource-name
Example with context: http://example.com:8080/confluence/rest/api/space/ds
Example without context: http://confluence.myhost.com:8095/rest/api/space/ds
In order to minimise network traffic from the client perspective, our API uses a technique called expansion.
You can use the expand
query parameter to specify a comma-separated list of entities that you want
expanded, identifying each entity by a given identifier. For example, the value space,attachments
requests the expansion of entities for which the expand identifier is space
and
attachments
.
You can use the .
dot notation to specify expansion of entities within another entity. For example
body.view
would expand the content body
and expand the view
rendering of
it.
This documents the current REST API provided by Confluence.
REST wrapper for the ContentService. Provides methods for finding, creating, modifying and deleting Content.
Creates a new piece of Content.
acceptable request representations:
{"type":"page","title":"Example Content title","space":{"key":"TST"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.605Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}}
Returns a full JSON representation of a piece of content
Returns a paginated list of Content.
Example request URI(s):
http://example.com/rest/api/content?spaceKey=TST&Title=Cheese&expand=space,body.view,version,container
http://example.com/rest/api/content?type=blogpost&spaceKey=TST&title=Bacon&postingDay=2014-02-13&expand=space,body.view,version,container
parameter | value | description |
---|---|---|
type |
Default: page |
the content type to return. Default value: |
spaceKey |
the space key to find content under. |
|
title |
the title of the page to find. Required for |
|
status |
list of statuses the content to be found is in. Defaults to current is not specified. If set to 'any', content in 'current' and 'trashed' status will be fetched. Does not support 'historical' status for now. |
|
postingDay |
the posting day of the blog post. Required for |
|
expand |
Default: |
a comma separated list of properties to expand on the content. Default value: |
start |
the start point of the collection to return |
|
limit |
Default: 25 |
the limit of the number of items to return, this may be restricted by fixed system limits |
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.605Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}}
Returns a full JSON representation of a list of content
available response representations:
Returned if the calling user does not have permission to view the content.
parameter | value | description |
---|---|---|
id |
the id of the content |
Returns a piece of Content.
Example request URI(s):
http://example.com/rest/api/content/1234?expand=space,body.view,version,container
http://example.com/rest/api/content/1234?status=any
parameter | value | description |
---|---|---|
status |
list of Content statuses to filter results on. Default value: |
|
version |
||
expand |
Default: history,space,version |
A comma separated list of properties to expand on the content. Default value: |
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.605Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}}
Returns a full JSON representation of a piece of content
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
Updates a piece of Content, or restores if it is trashed.
The body contains the representation of the content. Must include the new version number.
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}}
acceptable request representations:
{"id":"3604482","type":"page","title":"Example Content title","space":{"key":"TST"},"version":{"number":2,"minorEdit":false},"body":{"storage":{"value":"<p>This is the updated text for the new page</p>","representation":"storage"}}}
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.605Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}}
Returns a full JSON representation of a piece of content
available response representations:
Returned for invalid or missing arguments are passed on the content update or restore of trashed content.
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
Trashes or purges a piece of Content, based on its {@link ContentType} and {@link ContentStatus}.
There are three cases:
parameter | value | description |
---|---|---|
status |
available response representations:
Returned if successfully trashed.
available response representations:
Returned if successfully purged.
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to trash or purge the content.
parameter | value | description |
---|---|---|
id |
the id of the content |
Returns the history of a particular piece of content
Example request URI(s):
http://example.com/rest/api/content/1234/history
parameter | value | description |
---|---|---|
expand |
Default: previousVersion,nextVersion,lastUpdated |
the properties on content history to expand |
available response representations:
Returns a full JSON representation of the content's history
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
parameter | value | description |
---|---|---|
id |
a string containing the id of the content |
|
version |
the version of the content which the hash belongs |
|
hash |
the macroId to find the correct macro |
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 {@link #getContentById(com.atlassian.confluence.api.model.content.id.ContentId, java.util.List, Integer, String)} 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.
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.674Z","message":"initial edit","number":1,"minorEdit":false},"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"storage":{"value":"<h1>Example</h1><ac:macro ac:name=\"macro\"><ac:rich-text-body><p>This is the body of a macro.</p></ac:rich-text-body></ac:macro>","representation":"storage","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","descendants":""}}
Returns a json representation of a macro.
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content, or there is no macro matching the given hash or id.
parameter | value | description |
---|---|---|
macroId |
the macroId to find the correct macro |
|
id |
a string containing the id of the content |
|
version |
the version of the content to search |
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.
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.674Z","message":"initial edit","number":1,"minorEdit":false},"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"storage":{"value":"<h1>Example</h1><ac:macro ac:name=\"macro\"><ac:rich-text-body><p>This is the body of a macro.</p></ac:rich-text-body></ac:macro>","representation":"storage","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","descendants":""}}
Returns a json representation of a macro.
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content, or there is no macro matching the given id or hash.
Fetch a list of content using the Confluence Query Language (CQL). See : Advanced searching using CQL
For example :
Example request URI(s):
http://localhost:8080/confluence/rest/api/content/search?cql=creator=currentUser()&cqlcontext={%22spaceKey%22:%22TST%22,
%22contentId%22:%2255%22}
http://localhost:8080/confluence/rest/api/content/search?cql=space=DEV%20AND%20label=docs&expand=space,metadata.labels&limit=10
parameter | value | description |
---|---|---|
cql |
a cql query string to use to locate content |
|
cqlcontext |
the context to execute a cql search in, this is the json serialized form of SearchContext |
|
expand |
Default: |
a comma separated list of properties to expand on the content. |
start |
the start point of the collection to return |
|
limit |
Default: 25 |
the limit of the number of items to return, this may be restricted by fixed system limits |
available response representations:
Returns a paginated list of content
available response representations:
Returned if the CQL is invalid or missing
REST wrapper for the {@link ChildContentService}.
parameter | value | description |
---|---|---|
id |
a string containing the id of the content to retrieve children for |
Returns a map of the direct children of a piece of Content. Content can have multiple types of children - for example a Page can have children that are also Pages, but it can also have Comments and Attachments.
The {@link ContentType}(s) of the children returned is specified by the "expand" query parameter in the request
- this parameter can include expands for multiple child types.
If no types are included in the expand parameter, the map returned will just list the child types that are available
to be expanded for the {@link Content} referenced by the "id" path parameter.
Example request URI(s):
http://example.com/rest/api/content/1234/child
http://example.com/rest/api/content/1234/child?expand=page.body.VIEW
http://example.com/rest/api/content/1234/child?expand=page&start=20&limit=10
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the children |
parentVersion |
Default: 0 |
an int representing the version of the content to retrieve children for |
available response representations:
{"page":{"results":[{"id":"1234","type":"page","title":"Example Content title","links":{},"space":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"history":null,"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.686Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","links":{},"space":null,"history":null,"ancestors":null,"operations":null,"children":null,"descendants":null,"body":null,"metadata":null,"extensions":{}}],"operations":null,"children":null,"descendants":null,"container":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"body":{"view":{"representation":"view","value":"<p><h1>Example</h1>Some example content body</p>","content":null}},"metadata":null,"extensions":{}}],"size":1}}
Returns a JSON map representing multiple ordered collections of content children, keyed by content type
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
parameter | value | description |
---|---|---|
id |
a string containing the id of the content to retrieve children for |
|
id |
a string containing the id of the content to retrieve children for |
|
type |
a {@link ContentType} to filter children on. |
Returns the direct children of a piece of Content, limited to a single child type.
The {@link ContentType}(s) of the children returned is specified by the "type" path parameter in the request.
Example request URI(s):
http://example.com/rest/api/content/1234/child/page
http://example.com/rest/api/content/1234/child/comment
http://example.com/rest/api/content/1234/child/page?expand=body.view
http://example.com/rest/api/content/1234/child/comment?start=20&limit=10
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the children |
parentVersion |
Default: 0 |
an int representing the version of the content to retrieve children for |
start |
(optional, default: 0) the index of the first item within the result set that should be returned |
|
limit |
Default: 25 |
(optional, default: site limit) how many items should be returned after the start index |
available response representations:
{"page":{"results":[{"id":"1234","type":"page","title":"Example Content title","links":{},"space":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"history":null,"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.686Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","links":{},"space":null,"history":null,"ancestors":null,"operations":null,"children":null,"descendants":null,"body":null,"metadata":null,"extensions":{}}],"operations":null,"children":null,"descendants":null,"container":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"body":{"view":{"representation":"view","value":"<p><h1>Example</h1>Some example content body</p>","content":null}},"metadata":null,"extensions":{}}],"size":1}}
Returns a JSON map representing multiple ordered collections of content children, keyed by content type
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
parameter | value | description |
---|---|---|
id |
a string containing the id of the content to retrieve children for |
|
id |
a string containing the id of the content to retrieve children for |
Returns the comments of a content
Example request URI(s):
http://example.com/rest/api/content/1234/child/comment
http://example.com/rest/api/content/1234/child/comment?expand=body.view
http://example.com/rest/api/content/1234/child/comment?start=20&limit=10
http://example.com/rest/api/content/1234/child/comment?location=footer&location=inline&location=resolved
http://example.com/rest/api/content/1234/child/comment?expand=extensions.inlineProperties,extensions.resolution
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the children.
We can also specify some extensions such as |
parentVersion |
Default: 0 |
an int representing the version of the content to retrieve children for |
start |
(optional, default: 0) the index of the first item within the result set that should be returned |
|
limit |
Default: 25 |
(optional, default: site limit) how many items should be returned after the start index |
location |
(optional, default: "" means all) the location of the comments. Possible values are: "inline", "footer", "resolved". You can define multiple location params. The results will be the comments matched by any location. |
|
depth |
Default: |
(optional, default: "") the depth of the comments. Possible values are: "" (ROOT only), "all" |
available response representations:
{"page":{"results":[{"id":"1234","type":"page","title":"Example Content title","links":{},"space":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"history":null,"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.686Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","links":{},"space":null,"history":null,"ancestors":null,"operations":null,"children":null,"descendants":null,"body":null,"metadata":null,"extensions":{}}],"operations":null,"children":null,"descendants":null,"container":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"body":{"view":{"representation":"view","value":"<p><h1>Example</h1>Some example content body</p>","content":null}},"metadata":null,"extensions":{}}],"size":1}}
Returns a JSON map representing multiple ordered collections of content children, keyed by content type
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
CRUD operations for Attachments on Content.
parameter | value | description |
---|---|---|
id |
a string containing the id of the attachments content container |
Returns a paginated list of attachment Content entities within a single container.
Example request URI(s):
http://example.com/rest/api/content/1234/child/attachment?start=0&limit=10
http://example.com/rest/api/content/1234/child/attachment?filename=myfile.txt&expand=version,container
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the Attachments returned. Optional. |
start |
the index of the first item within the result set that should be returned. Optional. |
|
limit |
Default: 50 |
how many items should be returned after the start index. Optional. |
filename |
(optional) filter parameter to return only the Attachment with the matching file name. Optional. |
|
mediaType |
(optional) filter parameter to return only Attachments with a matching Media-Type. Optional. |
available response representations:
{"results":[{"id":"att5678","type":"attachment","title":"myfile.txt","version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.689Z","message":"change message for this edit","number":2,"minorEdit":false},"container":{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.689Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}},"metadata":{"comment":"This is my File","mediaType":"text/plain"},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/att5678"},"_expandable":{"operations":"","children":"","ancestors":"","body":"","descendants":""}}],"size":1,"_links":{"base":"http://myhost:8080/confluence","context":"/confluence"}}
Returns a JSON representation of a list of attachment Content entities
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
Add one or more attachments to a Confluence Content entity, with optional comments.
Comments are optional, but if included there must be as many comments as there are files, and the comments must be in the same order as the files.
This resource expects a multipart post. The media-type multipart/form-data is defined in RFC 1867. Most client libraries have classes that make dealing with multipart posts simple. For instance, in Java the Apache HTTP Components library provides a MultiPartEntity that makes it simple to submit a multipart POST.
In order to protect against XSRF attacks, because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: nocheck with the request, otherwise it will be blocked.
The name of the multipart/form-data parameter that contains attachments must be "file"
A simple example to attach a file called "myfile.txt" to the container with id "123", with a comment included:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" -F "comment=This is my File" http://myhost/rest/api/content/123/child/attachment
A example to attach a file called "myfile.txt" to the container with id "123", with a comment, and set the minorEdits flag to be true:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" -F "minorEdit=true" -F "comment=This is my File" http://myhost/rest/api/content/123/child/attachment
An example to attach the same file, with no comment:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" http://myhost/rest/api/content/123/child/attachment
Example request URI(s):
http://example.com/rest/api/content/1234/child/attachment
available response representations:
{"results":[{"id":"att5678","type":"attachment","title":"myfile.txt","version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.689Z","message":"change message for this edit","number":2,"minorEdit":false},"container":{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.689Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}},"metadata":{"comment":"This is my File","mediaType":"text/plain"},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/att5678"},"_expandable":{"operations":"","children":"","ancestors":"","body":"","descendants":""}}],"size":1,"_links":{"base":"http://myhost:8080/confluence","context":"/confluence"}}
available response representations:
Returned if attachments is disabled or if you don't have permission to add attachments to this content.
available response representations:
Returned if the requested content is not found, the user does not have permission to view it, or if the attachments exceeds the maximum configured attachment size.
parameter | value | description |
---|---|---|
id |
a string containing the id of the attachments content container |
|
attachmentId |
the id of the attachment to update |
Update the non-binary data of an Attachment.
This resource can be used to update an attachment's filename, media-type, comment, and parent container.
Example request URI(s):
http://example.com/rest/api/content/1234/child/attachment/5678
acceptable request representations:
{"id":"att5678","type":"attachment","title":"new_file_name.txt","version":{"number":2,"minorEdit":false}}
available response representations:
{"id":"att5678","type":"attachment","title":"myfile.txt","version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.679Z","message":"change message for this edit","number":2,"minorEdit":false},"container":{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.678Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}},"metadata":{"comment":"This is my File","mediaType":"text/plain"},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/att5678"},"_expandable":{"operations":"","children":"","ancestors":"","body":"","descendants":""}}
available response representations:
Returned if the attachment id or the attachment version number are invalid.
available response representations:
Returned if you are not permitted to update or move the attachment to a different container.
available response representations:
Returned if no attachment is found for the attachmentId.
available response representations:
Returned if the version of the supplied Attachment does not match the exact version of the Attachment stored in the database.
parameter | value | description |
---|---|---|
id |
a string containing the id of the attachments content container |
|
attachmentId |
the id of the attachment to upload a new file for |
Update the binary data of an Attachment, and optionally the comment and the minor edit field.
This adds a new version of the attachment, containing the new binary data, filename, and content-type.
When updating the binary data of an attachment, the comment related to it together with the field that specifies if it's a minor edit can be updated as well, but are not required. If an update is considered to be a minor edit, notifications will not be sent to the watchers of that content.
This resource expects a multipart post. The media-type multipart/form-data is defined in RFC 1867. Most client libraries have classes that make dealing with multipart posts simple. For instance, in Java the Apache HTTP Components library provides a MultiPartEntity that makes it simple to submit a multipart POST.
In order to protect against XSRF attacks, because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: nocheck with the request, otherwise it will be blocked.
The name of the multipart/form-data parameter that contains attachments must be "file"
A simple example to upload a file called "myfile.txt" to the Attachment with id "456" in a container with id "123", with the comment updated, and minorEdit set to true:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" -F "minorEdit=true" -F "comment=This is my updated File" http://myhost/rest/api/content/123/child/attachment/456/data
An example to upload the same file, with no comment:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" http://myhost/rest/api/content/123/child/attachment/456/data
Example request URI(s):
http://example.com/rest/api/content/1234/child/attachment/5678/data
available response representations:
{"results":[{"id":"att5678","type":"attachment","title":"myfile.txt","version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.689Z","message":"change message for this edit","number":2,"minorEdit":false},"container":{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.689Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}},"metadata":{"comment":"This is my File","mediaType":"text/plain"},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/att5678"},"_expandable":{"operations":"","children":"","ancestors":"","body":"","descendants":""}}],"size":1,"_links":{"base":"http://myhost:8080/confluence","context":"/confluence"}}
available response representations:
Returned if the attachment id is invalid.
available response representations:
Returned if no attachment is found for the attachmentId.
REST wrapper for the {@link ChildContentService}, when {@link Depth} is ALL.
parameter | value | description |
---|---|---|
id |
a string containing the id of the content to retrieve descendants for |
Returns a map of the descendants of a piece of Content. Content can have multiple types of descendants - for example a Page can have descendants that are also Pages, but it can also have Comments and Attachments.
The {@link ContentType}(s) of the descendants returned is specified by the "expand" query parameter in the request
- this parameter can include expands for multiple descendant types.
If no types are included in the expand parameter, the map returned will just list the descendant types that are available
to be expanded for the {@link Content} referenced by the "id" path parameter.
Currently the only supported descendants are comment descendants of non-comment Content.
Example request URI(s):
http://example.com/rest/api/content/1234/descendant
http://example.com/rest/api/content/1234/descendant?expand=comment.body.VIEW
http://example.com/rest/api/content/1234/descendant?expand=comment
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the descendants |
available response representations:
{"page":{"results":[{"id":"1234","type":"page","title":"Example Content title","links":{},"space":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"history":null,"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.686Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","links":{},"space":null,"history":null,"ancestors":null,"operations":null,"children":null,"descendants":null,"body":null,"metadata":null,"extensions":{}}],"operations":null,"children":null,"descendants":null,"container":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"body":{"view":{"representation":"view","value":"<p><h1>Example</h1>Some example content body</p>","content":null}},"metadata":null,"extensions":{}}],"size":1}}
Returns a JSON map representing multiple ordered collections of content descendants, keyed by content type
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
parameter | value | description |
---|---|---|
id |
a string containing the id of the content to retrieve descendants for |
|
id |
a string containing the id of the content to retrieve descendants for |
|
type |
a {@link ContentType} to filter descendants on. |
Returns the direct descendants of a piece of Content, limited to a single descendant type.
The {@link ContentType}(s) of the descendants returned is specified by the "type" path parameter in the request.
Currently the only supported descendants are comment descendants of non-comment Content.
Example request URI(s):
http://example.com/rest/api/content/1234/descendant/comment
http://example.com/rest/api/content/1234/descendant/comment?expand=body.VIEW
http://example.com/rest/api/content/1234/descendant/comment?start=20&limit=10
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the descendants |
start |
(optional, default: 0) the index of the first item within the result set that should be returned |
|
limit |
Default: 25 |
(optional, default: site limit) how many items should be returned after the start index |
available response representations:
{"page":{"results":[{"id":"1234","type":"page","title":"Example Content title","links":{},"space":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"history":null,"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.686Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","links":{},"space":null,"history":null,"ancestors":null,"operations":null,"children":null,"descendants":null,"body":null,"metadata":null,"extensions":{}}],"operations":null,"children":null,"descendants":null,"container":{"id":11,"key":"TST","name":"Example space","icon":null,"description":{"plain":{"representation":"plain","value":"This is an example space"}},"homepage":null},"body":{"view":{"representation":"view","value":"<p><h1>Example</h1>Some example content body</p>","content":null}},"metadata":null,"extensions":{}}],"size":1}}
Returns a JSON map representing multiple ordered collections of content descendants, keyed by content type
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
REST wrapper for the {@link ContentLabelService}.
parameter | value | description |
---|---|---|
id |
A string containing the id of the labels content container |
Returns the list of labels on a piece of Content.
Example request URI(s):
http://example.com/rest/api/content/1234/label
http://example.com/rest/api/content/1234/label?prefix=global&start=0&limit=200
parameter | value | description |
---|---|---|
prefix |
the prefixes to filter the labels with {@see Label.Prefix} |
|
start |
the start point of the collection to return |
|
limit |
Default: 200 |
the limit of the number of labels to return, this may be restricted by fixed system limits |
available response representations:
Returns a JSON representation of the labels on a piece of content
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
Adds a list of labels to the specified content.
The body is the json representation of the list.
acceptable request representations:
[{"prefix":"global","name":"label1"},{"prefix":"global","name":"label2"}]
available response representations:
Returns a JSON representation of the labels on a piece of content
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
Deletes a labels to the specified content.
parameter | value | description |
---|---|---|
name |
the name of the label to be removed from the content |
available response representations:
Empty response on successful delete
available response representations:
Returned if user has view permission, but no edit permission to the content
available response representations:
Returned if content or label doesn't exist, or calling user doesn't have view permission to the content
parameter | value | description |
---|---|---|
id |
A string containing the id of the labels content container |
|
id |
A string containing the id of the labels content container |
|
label |
the name of the label to be removed from the content |
Deletes a labels to the specified content. When calling this method through REST the label parameter doesn't accept "/" characters in label names, because of security constraints. For this case please use the query parameter version of this method (/content/{id}/label?name={label}
available response representations:
Returned if trying to delete a label with "/" in the name
available response representations:
Empty response on successful delete
available response representations:
Returned if user has view permission, but no edit permission to the content
available response representations:
Returned if content or label doesn't exist, or calling user doesn't have view permission to the content
A REST resource for manipulating content properties.
Content properties are a key / value store of properties attached to a piece of Content. The key is a string, and the value is a JSON object.
parameter | value | description |
---|---|---|
id |
the content to attach the property to |
Returns a paginated list of content properties.
Example request URI:
http://example.com/rest/api/content/1234/property?expand=content,version
parameter | value | description |
---|---|---|
expand |
a comma separated list of properties to expand on the content properties. Default value: |
|
start |
the start point of the collection to return |
|
limit |
Default: 10 |
the limit of the number of items to return, this may be restricted by fixed system limits |
available response representations:
{"results":[{"key":"example-property-key","value":{"anything":"goes"},"content":{"id":"1234","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}},"version":{"number":2,"minorEdit":false},"_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234/property/example-property-key"}}],"size":1,"_links":{"base":"http://myhost:8080/confluence","context":"/confluence"}}
Returns a full JSON representation of the content property list
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
Creates a new content property.
acceptable request representations:
{"key":"example-property-key","value":{"anything":"goes"}}
available response representations:
{"key":"example-property-key","value":{"anything":"goes"},"content":{"id":"1234","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}},"version":{"number":2,"minorEdit":false},"_links":{"base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234/property/example-property-key"}}
Returns a full JSON representation of the content property
available response representations:
Returned if the given property has a different ContentId to the one in the path, or if the content already has a value with the given key, or the value is missing, or the value is too long.
available response representations:
Returned if the user does not have permission to edit the content with the given ContentId
parameter | value | description |
---|---|---|
id |
the content to attach the property to |
|
id |
the content to attach the property to |
|
key |
Returns a content property.
Example request URI:
http://example.com/rest/api/content/1234/property/example-property-key?expand=content,version
parameter | value | description |
---|---|---|
expand |
a comma separated list of properties to expand on the content properties. Default value: |
available response representations:
{"key":"example-property-key","value":{"anything":"goes"},"content":{"id":"1234","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}},"version":{"number":2,"minorEdit":false},"_links":{"base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234/property/example-property-key"}}
Returns a full JSON representation of the content property
available response representations:
Returned if there is no content with the given id, or no property with the given key, or if the calling user does not have permission to view the content.
Updates a content property.
The body contains the representation of the content property. Must include the property id, and the new version number. Attempts to create a new content property if the given version number is 1, just like {@link #create(com.atlassian.confluence.api.model.content.id.ContentId, String, com.atlassian.confluence.api.model.content.JsonContentProperty)}.
acceptable request representations:
{"key":"example-property-key","value":{"anything":"goes"},"version":{"number":2,"minorEdit":false}}
available response representations:
{"key":"example-property-key","value":{"anything":"goes"},"content":{"id":"1234","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}},"version":{"number":2,"minorEdit":false},"_links":{"base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234/property/example-property-key"}}
Returns a full JSON representation of a piece of content
available response representations:
Returned if the given property has a different ContentId to the one in the path, or if the property has a different key to the one in the path, or the value is missing, or the value is too long.
available response representations:
Returned if the user does not have permission to edit the content with the given ContentId
available response representations:
Returned if there is no content with the given id, or no property with the given key, or if the calling user does not have permission to view the content.
available response representations:
Returned if the given version is does not match the expected target version of the updated property
Deletes a content property.
available response representations:
Returned if successfully deleted.
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
Creates a new content property.
acceptable request representations:
{"key":"example-property-key","value":{"anything":"goes"}}
available response representations:
{"key":"example-property-key","value":{"anything":"goes"},"content":{"id":"1234","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}},"version":{"number":2,"minorEdit":false},"_links":{"base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234/property/example-property-key"}}
Returns a full JSON representation of the content property
available response representations:
Returned if the given property has a different ContentId to the one in the path, or if the content already has a value with the given key, or the value is missing, or the value is too long.
available response representations:
Returned if the user does not have permission to edit the content with the given ContentId
parameter | value | description |
---|---|---|
id |
the id of the content |
Returns info about all restrictions by operation
parameter | value | description |
---|---|---|
expand |
Default: update.restrictions.user,read.restrictions.group,read.restrictions.user,update.restrictions.group |
a comma separated list of properties to expand on the content properties. Default value: group. |
available response representations:
Returns a JSON representation of the restrictions group by operations
parameter | value | description |
---|---|---|
operationKey |
key of the operation |
|
id |
the id of the content |
Returns info about all restrictions of given operation
parameter | value | description |
---|---|---|
expand |
Default: restrictions.user,restrictions.group |
a comma separated list of properties to expand on the content properties. Default value: group. |
start |
pagination start |
|
limit |
Default: 100 |
pagination limit |
available response representations:
Returns a JSON representation of the restrictions of given operation
Used for converting ContentBody objects from one format to another.
parameter | value | description |
---|---|---|
to |
the representation to convert to |
Converts between content body representations.
Not all representations can be converted to/from other formats. Supported conversions:
Source Representation | Destination Representation Supported |
---|---|
storage | view,export_view,editor |
editor | storage |
view | None |
export_view | None |
Example request URI(s):
http://example.com/rest/api/contentbody/convert/view
acceptable request representations:
{"value":"<p>Some example body in storage format</p>","representation":"storage"}
available response representations:
{"value":"<p>Some example body in storage format</p>","representation":"storage","_links":{"base":"http://myhost:8080/confluence","context":"/confluence"},"_expandable":{"content":"/rest/api/content/3604482"}}
REST wrapper for the LongTaskService.
Returns information about all tracked long-running tasks.
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the tasks |
start |
||
limit |
Default: 100 |
available response representations:
Returns a full JSON representation of a list of long tasks
parameter | value | description |
---|---|---|
id |
the key of the task to be returned |
Returns information about a long-running task.
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the task |
available response representations:
Returns a full JSON representation of a long task
available response representations:
Returned if there is no task with the given key, or if the calling user does not have permission to view it
REST wrapper for the SpaceService.
Creates a new Space.
The incoming Space does not include an id, but must include a Key and Name, and should include a Description.
acceptable request representations:
{"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}}}
available response representations:
{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"collection":"/rest/api/space","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/space/TST"}}
Returns a full JSON representation of a space
Returns information about a number of spaces.
Example request URI(s):
http://example.com/rest/api/space?spaceKey=TST&spaceKey=ds
parameter | value | description |
---|---|---|
spaceKey |
a list of space keys |
|
expand |
Default: |
a comma separated list of properties to expand on the spaces |
start |
the start point of the collection to return |
|
limit |
Default: 25 |
the limit of the number of spaces to return, this may be restricted by fixed system limits |
available response representations:
Returns an array of full JSON representations of found spaces
Creates a new private Space, viewable only by its creator.
The incoming Space does not include an id, but must include a Key and Name, and should include a Description.
acceptable request representations:
{"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}}}
available response representations:
{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"collection":"/rest/api/space","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/space/TST"}}
Returns a full JSON representation of a space
parameter | value | description |
---|---|---|
spaceKey |
the key of the space to delete |
Updates a Space.
Currently only the Space name, description and homepage can be updated.
acceptable request representations:
{"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}}}
available response representations:
{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"collection":"/rest/api/space","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/space/TST"}}
Returns a full JSON representation of a space
available response representations:
Returned if there is no space with the given key, or if the calling user does not have permission to update it.
Deletes a Space.
The space is deleted in a long running task, so the space cannot be considered deleted when this resource returns. Clients can follow the status link in the response and poll it until the task completes.
available response representations:
Returns a pointer to the status of the space-deletion task
available response representations:
Returned if there is no space with the given key, or if the calling user does not have permission to delete it.
parameter | value | description |
---|---|---|
spaceKey |
a string containing the key of the space |
Returns information about a space.
Example request URI(s):
http://example.com/rest/api/space/TST?expand=description
parameter | value | description |
---|---|---|
expand |
Default: |
a comma separated list of properties to expand on the space |
available response representations:
Returns a full JSON representation of a space
available response representations:
Returned if there is no space with the given key, or if the calling user does not have permission to view the space.
parameter | value | description |
---|---|---|
spaceKey |
a string containing the key of the space |
Returns the content in this given space
Example request URI(s):
http://example.com/rest/api/space/TEST/content?expand=history
parameter | value | description |
---|---|---|
depth |
Default: all |
a string indicating if all content, or just the root content of the space is returned. Default value: |
expand |
Default: |
a comma separated list of properties to expand on each piece of content retrieved |
start |
the start point of the collection to return |
|
limit |
Default: 25 |
the limit of the number of labels to return, this may be restricted by fixed system limits |
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.605Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}}
Returns a full JSON representation of a piece of content
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.
parameter | value | description |
---|---|---|
spaceKey |
a string containing the key of the space |
|
type |
the type of content to return with the space. Valid values: |
Returns the content in this given space with the given type
Example request URI(s):
http://example.com/rest/api/space/TEST/content/page?expand=history
parameter | value | description |
---|---|---|
depth |
Default: all |
a string indicating if all content, or just the root content of the space is returned. Default value: |
expand |
Default: |
a comma separated list of properties to expand on each piece of content retrieved |
start |
the start point of the collection to return |
|
limit |
Default: 25 |
the limit of the number of labels to return, this may be restricted by fixed system limits |
available response representations:
{"id":"1234","type":"page","title":"Example Content title","space":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"version":{"by":{"type":"known","username":"username","displayName":"Full Name","userKey":""},"when":"2015-10-08T08:34:46.605Z","message":"change message for this edit","number":2,"minorEdit":false},"ancestors":[{"id":"123","type":"page","_links":{"self":"http://myhost:8080/confluence/rest/api/content/123"},"_expandable":{"metadata":"","operations":"","children":"","ancestors":"","body":"","descendants":""}}],"container":{"id":11,"key":"TST","name":"Example space","description":{"plain":{"value":"This is an example space","representation":"plain"}},"_links":{"self":"http://myhost:8080/confluence/rest/api/space/TST"}},"body":{"view":{"value":"<p><h1>Example</h1>Some example content body</p>","representation":"view","_expandable":{"content":"/rest/api/content/1234"}}},"_links":{"collection":"/rest/api/content","base":"http://myhost:8080/confluence","context":"/confluence","self":"http://myhost:8080/confluence/rest/api/content/1234"},"_expandable":{"metadata":"","operations":"","children":"","descendants":""}}
Returns a full JSON representation of a piece of content
available response representations:
Returned if there is no content with the given id, or if the calling user does not have permission to view the content.