GET

Get labels

Returns the list of labels on a piece of Content. Example request URI(s):

  • http://example.com/confluence/rest/api/content/1234/label
  • http://example.com/confluence/rest/api/content/1234/label?prefix=global&start=0&limit=200

Request

Path parameters

id

string

Required

Query parameters

prefix

string

limit

string

start

string

Responses

returns a JSON representation of the existing labels on the content with the given id

application/json

object
GET/rest/api/content/{id}/label
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/label' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 { "results": [ { "prefix": "my", "name": "label", "id": "1234", "label": "<string>", "_links": { "base": "<string>", "context": "<string>", "self": "<string>" }, "_expandable": { "attribute": "<string>" } } ], "totalCount": 2154, "start": 25, "limit": 25, "size": 25, "_links": { "base": "http://localhost:8085/confluence", "context": "confluence", "self": "http://localhost:8085/rest/api/latest/..?limit=25&start=25", "next": "http://localhost:8085/rest/api/latest/..?limit=25&start=50", "prev": "http://localhost:8085/rest/api/latest/..?limit=25&start=0" } }
POST

Add Labels

Adds a list of labels to the specified content. The body is the json representation of the list.

Request

Path parameters

id

string

Required

Request bodyapplication/json

a single label object or a list of labels to add

prefix

string

name

string

id

string

label

string

_links

object

_expandable

object

Responses

returns a JSON representation of the existing and added labels on the content with the given id, or a 404 NOT FOUND if there is no content with the given id or if the user is not permitted. An empty list will be returned if there are no labels on the given content

application/json

object
POST/rest/api/content/{id}/label
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 curl --request POST \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/label' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "prefix": "my", "name": "label", "id": "1234", "label": "<string>", "_links": { "base": "<string>", "context": "<string>", "self": "<string>" }, "_expandable": { "attribute": "<string>" } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 { "results": [ { "prefix": "my", "name": "label", "id": "1234", "label": "<string>", "_links": { "base": "<string>", "context": "<string>", "self": "<string>" }, "_expandable": { "attribute": "<string>" } } ], "totalCount": 2154, "start": 25, "limit": 25, "size": 25, "_links": { "base": "http://localhost:8085/confluence", "context": "confluence", "self": "http://localhost:8085/rest/api/latest/..?limit=25&start=25", "next": "http://localhost:8085/rest/api/latest/..?limit=25&start=50", "prev": "http://localhost:8085/rest/api/latest/..?limit=25&start=0" } }
DEL

Delete label with query param

Deletes a labels to the specified content.

Request

Path parameters

id

string

Required

Query parameters

name

string

Responses

returns no response on successful delete

DEL/rest/api/content/{id}/label
1 2 curl --request DELETE \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/label'
DEL

Delete label

Deletes a labels to the specified content. The body is the json representation of the list. 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})

Request

Path parameters

id

string

Required
label

string

Required

Responses

returns no response on successful delete

DEL/rest/api/content/{id}/label/{label}
1 2 curl --request DELETE \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/label/{label}'

Rate this page: