Skip to content

labels

add

Add labels to a page (uses v1 API)

FlagTypeRequiredDescription
--labelstringSliceNoLabel name to add (repeatable, e.g. --label foo --label bar)
--page-idstringNoPage ID to add labels to (required)

Example:

bash
cf labels add

get

Get labels

Returns all labels. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to access the Confluence site ('Can use' global permission). Only labels that the user has permission to view will be returned.

GET /labels

FlagTypeRequiredDescription
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--label-idstringNoFilters on label ID. Multiple IDs can be specified as a comma-separated list.
--limitstringNoMaximum number of labels per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--prefixstringNoFilters on label prefix. Multiple IDs can be specified as a comma-separated list.
--sortstringNoUsed to sort the result by a particular field.

Example:

bash
cf labels get

get-attachments

Get attachments for label

Returns the attachments of specified label. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to view the attachment and its corresponding space.

GET /labels/{id}/attachments

FlagTypeRequiredDescription
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--idstringYesThe ID of the label for which attachments should be returned.
--limitstringNoMaximum number of pages per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--sortstringNoUsed to sort the result by a particular field.

Example:

bash
cf labels get-attachments --id <id>

get-blog-posts

Get blog posts for label

Returns the blogposts of specified label. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to view the content of the page and its corresponding space.

GET /labels/{id}/blogposts

FlagTypeRequiredDescription
--body-formatstringNoThe content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--idstringYesThe ID of the label for which blog posts should be returned.
--limitstringNoMaximum number of blog posts per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--sortstringNoUsed to sort the result by a particular field.
--space-idstringNoFilter the results based on space ids. Multiple space ids can be specified as a comma-separated list.

Example:

bash
cf labels get-blog-posts --id <id>

get-pages

Get pages for label

Returns the pages of specified label. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to view the content of the page and its corresponding space.

GET /labels/{id}/pages

FlagTypeRequiredDescription
--body-formatstringNoThe content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.
--cursorstringNoUsed for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.
--idstringYesThe ID of the label for which pages should be returned.
--limitstringNoMaximum number of pages per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results.
--sortstringNoUsed to sort the result by a particular field.
--space-idstringNoFilter the results based on space ids. Multiple space ids can be specified as a comma-separated list.

Example:

bash
cf labels get-pages --id <id>

list

List labels on a page

FlagTypeRequiredDescription
--page-idstringNoPage ID to list labels for (required)

Example:

bash
cf labels list

remove

Remove a label from a page (uses v1 API)

FlagTypeRequiredDescription
--labelstringNoLabel name to remove (required)
--page-idstringNoPage ID to remove label from (required)

Example:

bash
cf labels remove