Cloud
Confluence Cloud / Reference / REST API
DEL

Delete page tree

Moves a pagetree rooted at a page to the space's trash:

  • If the content's type is page and its status is current, it will be trashed including all its descendants.
  • For every other combination of content type and status, this API is not supported.

This API accepts the pageTree delete request and returns a task ID. The delete process happens asynchronously.

Response example:

1 2 3 4 5 6 7 8 { "id" : "1180606", "links" : { "status" : "/rest/api/longtask/1180606" } }

Use the /longtask/<taskId> REST API to get the copy task status.

Permissions required: 'Delete' permission for the space that the content is in.

Data Security Policy: Not exempt from app access rules
Scopes
ClassicRECOMMENDED:write:confluence-content
Granular:delete:content:confluence

Connect app scope requiredDELETE

Request

Path parameters

id

string

Required

Responses

Returned if the request to trash content and all its current page descendants, is successfully accepted.

application/json

LongTask
DEL/wiki/rest/api/content/{id}/pageTree
1 2 3 4 5 6 7 8 9 10 11 12 13 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import api, { route } from "@forge/api"; const response = await api.asUser().requestConfluence(route`/wiki/rest/api/content/{id}/pageTree`, { method: 'DELETE', headers: { 'Accept': 'application/json' } }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
202Response
1 2 3 4 5 6 7 { "ari": "<string>", "id": "<string>", "links": { "status": "<string>" } }
GET

Get Space LabelsExperimental

Returns a list of labels associated with a space. Can provide a prefix as well as other filters to select different types of labels.

Data Security Policy: Exempt from app access rules
Scopes
ClassicRECOMMENDED:read:confluence-space.summary
Granular:read:label:confluence

Connect app scope requiredREAD

Request

Path parameters

spaceKey

string

Required

Query parameters

prefix

string

start

integer

limit

integer

Responses

Returned if the list of labels is returned.

application/json

LabelArray
GET/wiki/rest/api/space/{spaceKey}/label
1 2 3 4 5 6 7 8 9 10 11 12 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import api, { route } from "@forge/api"; const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/label`, { headers: { 'Accept': 'application/json' } }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "results": [ { "prefix": "<string>", "name": "<string>", "id": "<string>", "label": "<string>" } ], "start": 2154, "limit": 2154, "size": 2154, "_links": {} }
POST

Add labels to a spaceExperimental

Adds labels to a piece of content. Does not modify the existing labels.

Notes:

  • Labels can also be added when creating content (Create content).
  • Labels can be updated when updating content (Update content). This will delete the existing labels and replace them with the labels in the request.

Permissions required: Permission to update the content.

Data Security Policy: Exempt from app access rules
Scopes
ClassicRECOMMENDED:write:confluence-space
Granular:read:label:confluence, write:label:confluence

Connect app scope requiredWRITE

Request

Path parameters

spaceKey

string

Required

Request bodyapplication/json

The labels to add to the content.

array<LabelCreate>

prefix

string

Required
name

string

Required
Additional Properties

any

Responses

Returned if the labels are added to the content.

application/json

LabelArray
POST/wiki/rest/api/space/{spaceKey}/label
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import api, { route } from "@forge/api"; var bodyData = `[ { "prefix": "<string>", "name": "<string>" } ]`; const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/label`, { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: bodyData }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "results": [ { "prefix": "<string>", "name": "<string>", "id": "<string>", "label": "<string>" } ], "start": 2154, "limit": 2154, "size": 2154, "_links": {} }
DEL

Remove label from a spaceExperimental

Data Security Policy: Exempt from app access rules
Scopes
ClassicRECOMMENDED:write:confluence-space
Granular:write:label:confluence

Connect app scope requiredWRITE

Request

Path parameters

spaceKey

string

Required

Query parameters

name

string

Required
prefix

string

Responses

Returned if the label was successfully deleted.

DEL/wiki/rest/api/space/{spaceKey}/label
1 2 3 4 5 6 7 8 9 10 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import api, { route } from "@forge/api"; const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/label?name={name}`, { method: 'DELETE' }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.text());

Rate this page: