Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API: Get all labels within a space

Blake Pitts July 30, 2018

I'm trying to return all the labels within a space. Is there a way to do this?

 

Thank you,

Blake

1 answer

1 vote
Zak Laughton
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2018

Hi Blake,

There's not a way to directly search for all labels within a space using the REST API, but as an alternative you can return all pages with their labels.

You can use this URL to return all pages with their labels (replacing with your site and spacekey):

https://<sitename>.atlassian.net/wiki/rest/api/content?spacekey=<spacekey>&expand=metadata.labels

Then, you can use a script to parse through the results to find the unique labels in the metadata.labels object for each page.

-Zak

Vakalos Mixalis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 26, 2021

@Zak Laughton 
Hello Zak,

We are using the URL you have posted to load and search labels through a drop-down field but I think there is a small problem.

On a big scale with hundreds of pages and labels, the page takes too long to load
all the labels and it's a bit annoying.

Is there any alternative way to do this?
Like when we adding labels in a page and there are some suggestions like the photo.

Thank you,
Mixalis

image (2).png

Like # people like this
Alois Igelspacher
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 2, 2021

Would be indeed very nice to have an endpoint, that returns all labels used in a specific space.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events