Welcome to the Confluence REST API Extension reference.
Structure of the REST URIs
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
How to use expansion in the REST APIs
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.
Resources
/cwxapiextension/latest/groups
Resource for group actions.
Add group member/s - POST: /cwxapiextension/latest/groups/add-users
Add group member/s.
POST /cwxapiextension/latest/groups/add-users
{
"group":"team-members",
"users":
[
"demouser1",
"demouser2"
]
}
{
"group":"string",
"users":[string]
}
Remove group member/s - POST: /cwxapiextension/latest/groups/remove-users
Remove group member/s.
POST /cwxapiextension/latest/groups/remove-users
{
"group":"team-members",
"users":
[
"demouser1",
"demouser2"
]
}
{
"group":"string",
"users":[string]
}
Set group member/s - POST: /cwxapiextension/latest/groups/set-users
Set group member/s.
POST /cwxapiextension/latest/groups/set-users
{
"group":"team-members",
"users":
[
"demouser1",
"demouser2"
]
}
{
"group":"string",
"users":[string]
}
/cwxapiextension/latest/permissions
Resource for permission actions.
Add users and groups to edit page permission - PUT: /cwxapiextension/latest/permissions/edit/{pageId}
Add users and groups to edit page permission.
PUT /cwxapiextension/latest/permissions/edit/{pageId}
{
"groups":
[
"confluence-users",
"confluence-administrators"
],
"users":
[
"demouser1",
"demouser2"
]
}
{
"groups":[string],
"users":[string]
}
Remove users and groups from edit page permission - POST: /cwxapiextension/latest/permissions/edit/{pageId}
Remove users and groups from edit page permission.
DELETE /cwxapiextension/latest/permissions/edit/{pageId}
{
"groups":
[
"confluence-users",
"confluence-administrators"
],
"users":
[
"demouser1",
"demouser2"
]
}
{
"groups":[string],
"users":[string]
}
Add users and groups to view page permission - POST: /cwxapiextension/latest/permissions/view/{pageId}
Add users and groups to view page permission.
PUT /cwxapiextension/latest/permissions/view/{pageId}
{
"groups":
[
"confluence-users",
"confluence-administrators"
],
"users":
[
"demouser1",
"demouser2"
]
}
{
"groups":[string],
"users":[string]
}
Remove users and groups from view page permission - POST: /cwxapiextension/latest/permissions/view/{pageId}
Remove users and groups from view page permission.
DELETE /cwxapiextension/latest/permissions/view/{pageId}
{
"groups":
[
"confluence-users",
"confluence-administrators"
],
"users":
[
"demouser1",
"demouser2"
]
}
{
"groups":[string],
"users":[string]
}
Remove users and groups from all page permissions - POST: /cwxapiextension/latest/permissions/all/{pageId}
Remove users and groups from all page permissions.
DELETE /cwxapiextension/latest/permissions/all/{pageId}
{
"groups":
[
"confluence-users",
"confluence-administrators"
],
"users":
[
"demouser1",
"demouser2"
]
}
{
"group":[string],
"users":[string]
}
/cwxapiextension/latest/spaces
Resource for space actions.
Add Space Sidebar Link - POST: /cwxapiextension/latest/spaces/add-sidebar-link
Adds a given link with a given name to the space sidebar.
POST /cwxapiextension/latest/spaces/add-sidebar-link
{
"spaceKey": "DEMO",
"label": "Link Name",
"url": "http://demosite.com/"
}
{
"spaceKey": "string",
"label": "string",
"url": "string"
}
Copy Space - POST: /cwxapiextension/latest/spaces/copySpace
Creates a new space with the given information based on a given template space.
POST /cwxapiextension/latest/spaces/copySpace?{URI_PARAMS}
POST /cwxapiextension/latest/spaces/copySpace?sourceSpaceKey=TEMP&targetSpaceKey=DEMO&targetSpaceTitle=DemoSpace&targetSpaceAdmin=username&removeAdminPermissions=true&keepPagesMetadata=false
POST /cwxapiextension/latest/spaces/copySpace?{URI_PARAMS}
@param sourceSpaceKey the space to copy (String)
@param targetSpaceKey key for the new space (String)
@param targetSpaceTitle title for the new space (String)
@param targetSpaceAdmin the admin user to use (keep empty to pick a default admin) (String)
@param removeAdminPermissions if the admin user should be removed from space permissions (Boolean)
@param keepPagesMetadata if the page metadata of the template space should be kept (authors, dates) (Boolean)
Check if space already exists - POST: /cwxapiextension/latest/spaces/isUnique
Check if a space with the given space key and space name already exists.
POST /cwxapiextension/latest/spaces/isUnique?{URI_PARAMS}
POST /cwxapiextension/latest/spaces/isUnique?spaceKey=DEMO&spaceName=DemoSpace
POST /cwxapiextension/latest/spaces/isUnique?{URI_PARAMS}
@param spaceKey (String)
@param spaceName (String)
Replace text in existing page - POST: /cwxapiextension/latest/spaces/replaceInPage
Replace text in page body and title
POST /cwxapiextension/latest/spaces/replaceInPage?{URI_PARAMS}
POST /cwxapiextension/latest/spaces/replaceInPage?spaceKey=DEMO&pageTitle=DemoPage
Body:
[
{
"oldText":"old",
"newText":"new"
},
{
"oldText":"good",
"newText":"better"
}
]
POST /cwxapiextension/latest/spaces/replaceInPage?{URI_PARAMS}
@param spaceKey (String)
@param pageTitle (String)
Body:
[
{
"oldText":"string",
"newText":"string"
},
{
"oldText":"string",
"newText":"string"
}
]
Get Space Status - GET: /cwxapiextension/latest/spaces/status/{space}
Get a space's status.
GET /cwxapiextension/latest/spaces/status/{SPACE}
GET /cwxapiextension/latest/spaces/status/DEMO
Response:
{
"result": "current"
}
GET /cwxapiextension/latest/spaces/status/{SPACE}
@param SPACE (String)
Response body:
{
"result": "string"
}
Update Space Status - PUT: /cwxapiextension/latest/spaces/status/{space}
Update a space's status.
PUT /cwxapiextension/latest/spaces/status/{SPACE}
PUT /cwxapiextension/latest/spaces/status/DEMO
Body:
{
"status": "archived"
}
PUT /cwxapiextension/latest/spaces/status/{SPACE}
@param SPACE (String)
Body:
{
"status":"string"
}
Supported values for status: archived, current.