GET

Get labels for contentDeprecated

Deprecated, use Confluence's v2 API.

Returns the labels on a piece of content.

Permissions required: 'View' permission for the space and permission to view the content if it is a page.

Data Security Policy: Not exempt from app access rules
Scopes
ClassicRECOMMENDED:read:confluence-content.summary
Granular:read:label:confluence

Connect app scope requiredREAD

Request

Path parameters

id

string

Required

Query parameters

prefix

string

start

integer

limit

integer

Responses

Returned if the requested labels are returned.

application/json

LabelArray
GET/wiki/rest/api/content/{id}/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/content/{id}/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 content

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: Not exempt from app access rules
Scopes
ClassicRECOMMENDED:write:confluence-content
Granular:read:label:confluence, write:label:confluence

Connect app scope requiredWRITE

Request

Path parameters

id

string

Required

Request bodyapplication/json

The labels to add to the content.

oneOf [array<LabelCreate>, LabelCreate]

LabelCreate

Responses

Returned if the labels are added to the content.

application/json

LabelArray
POST/wiki/rest/api/content/{id}/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/content/{id}/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 content using query parameter

Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to Remove label from content except that the label name is specified via a query parameter.

Use this method if the label name has "/" characters, as Remove label from content using query parameter does not accept "/" characters for the label name.

Permissions required: Permission to update the content.

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

Connect app scope requiredWRITE

Request

Path parameters

id

string

Required

Query parameters

name

string

Required

Responses

Returned if the label is removed. The response body will be empty.

DEL/wiki/rest/api/content/{id}/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/content/{id}/label?name={name}`, { method: 'DELETE' }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.text());
DEL

Remove label from content

Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to Remove label from content using query parameter except that the label name is specified via a path parameter.

Use this method if the label name does not have "/" characters, as the path parameter does not accept "/" characters for security reasons. Otherwise, use Remove label from content using query parameter.

Permissions required: Permission to update the content.

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

Connect app scope requiredWRITE

Request

Path parameters

id

string

Required
label

string

Required

Responses

Returned if the label is removed. The response body will be empty.

DEL/wiki/rest/api/content/{id}/label/{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/content/{id}/label/{label}`, { method: 'DELETE' }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.text());

Rate this page: