REST API Reference

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



Example
{
  "group":"team-members",
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "group":"string",
  "users":[string]
}


Remove group member/s.


POST /cwxapiextension/latest/groups/remove-users



Example
{
  "group":"team-members",
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "group":"string",
  "users":[string]
}


Set group member/s.


POST /cwxapiextension/latest/groups/set-users



Example
{
  "group":"team-members",
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "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}



Example
{
  "groups":
    [
      "confluence-users",
      "confluence-administrators"
    ],
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "groups":[string],
  "users":[string]
}


Remove users and groups from edit page permission.


DELETE /cwxapiextension/latest/permissions/edit/{pageId}



Example
{
  "groups":
    [
      "confluence-users",
      "confluence-administrators"
    ],
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "groups":[string],
  "users":[string]
}


Add users and groups to view page permission.


PUT /cwxapiextension/latest/permissions/view/{pageId}



Example
{
  "groups":
    [
      "confluence-users",
      "confluence-administrators"
    ],
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "groups":[string],
  "users":[string]
}


Remove users and groups from view page permission.


DELETE /cwxapiextension/latest/permissions/view/{pageId}



Example
{
  "groups":
    [
      "confluence-users",
      "confluence-administrators"
    ],
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "groups":[string],
  "users":[string]
}


Remove users and groups from all page permissions.


DELETE /cwxapiextension/latest/permissions/all/{pageId}



Example
{
  "groups":
    [
      "confluence-users",
      "confluence-administrators"
    ],
  "users":
    [
      "demouser1",
      "demouser2"
    ]
}



Scheme
{
  "group":[string],
  "users":[string]
}



/cwxapiextension/latest/spaces


Resource for space actions.



Adds a given link with a given name to the space sidebar.


POST /cwxapiextension/latest/spaces/add-sidebar-link



Example
{
	"spaceKey": "DEMO",
	"label": "Link Name",
	"url": "http://demosite.com/"
}



Scheme
{
	"spaceKey": "string",
	"label": "string",
	"url": "string"
}


Creates a new space with the given information based on a given template space.


POST /cwxapiextension/latest/spaces/copySpace?{URI_PARAMS}



Example
POST /cwxapiextension/latest/spaces/copySpace?sourceSpaceKey=TEMP&targetSpaceKey=DEMO&targetSpaceTitle=DemoSpace&targetSpaceAdmin=username&removeAdminPermissions=true&keepPagesMetadata=false



URI Parameters
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 a space with the given space key and space name already exists.


POST /cwxapiextension/latest/spaces/isUnique?{URI_PARAMS}



Example
POST /cwxapiextension/latest/spaces/isUnique?spaceKey=DEMO&spaceName=DemoSpace



Scheme
POST /cwxapiextension/latest/spaces/isUnique?{URI_PARAMS}

@param spaceKey (String)
@param spaceName (String)


Replace text in page body and title


POST /cwxapiextension/latest/spaces/replaceInPage?{URI_PARAMS}



Example
POST /cwxapiextension/latest/spaces/replaceInPage?spaceKey=DEMO&pageTitle=DemoPage

Body:

[
  {
    "oldText":"old",
    "newText":"new"
  },
  {
    "oldText":"good",
    "newText":"better"
  }
]



Scheme
POST /cwxapiextension/latest/spaces/replaceInPage?{URI_PARAMS}

@param spaceKey (String)
@param pageTitle (String)

Body:

[
  {
    "oldText":"string",
    "newText":"string"
  },
  {
    "oldText":"string",
    "newText":"string"
  }
]

Get a space's status.

GET /cwxapiextension/latest/spaces/status/{SPACE}
Example
GET /cwxapiextension/latest/spaces/status/DEMO

Response:
{
	"result": "current"
}
Scheme
GET /cwxapiextension/latest/spaces/status/{SPACE}

@param SPACE (String)

Response body:
{
    "result": "string"
}

Update a space's status.


PUT /cwxapiextension/latest/spaces/status/{SPACE}
Example
PUT /cwxapiextension/latest/spaces/status/DEMO

Body:

{
    "status": "archived"
}
Scheme
PUT /cwxapiextension/latest/spaces/status/{SPACE}

@param SPACE (String)

Body:

{
    "status":"string"
}

Supported values for status: archived, current.