Jira label endpoint not available?

I am trying to access /rest/api/2/label, but all i get is a 404
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-labels/#api-group-labels the documentation says there should be an endpoint to get all labels, seems like not on my server. Do i have to somehow configure that, that this is available? Is this only for the Cloud-Version?

Hello @Oli1

Yes, as you’ve discovered, Jira Server is not the same as Jira Cloud. You will need to read the REST API documentation for your version of Jira Server to know if it had a particular feature.

thanks, but it seems like this is not available in general in the on-premise version. can you confirm that?

You may try this endpoint:
With fieldName = “labels”
If I remember correctly, this endpoint may not work in all use cases as you can’t get labels from label custom fields

Hello @Oli1

Not sure what you mean by ‘in general’, as your question is about REST API endpoints.
Not sure what you mean by ‘on-premise version’, but I guess you mean Jira Server (or possibly Jira Datacenter).
Not sure what you mean by ‘can you confirm that’, as it’s you who knows what product and version of it you’re using and you who needs to read the corresponding documentation, such as the Jira Server v9.4.0 REST API documentation, to confirm for yourself if that endpoint exists for that version of that product.

HINT. A 404 error means “Can’t find that resource”. That’s probably the answer right there.

If that version of that product doesn’t have that endpoint, then you have to consider a possible work-around, such as the one suggested by @m.herrmann , which may or may not meet your requirements.

With “in general” i mean: all Jira Server Versions
Yes, with on-premise i mean the Jira-Server.
I read the Jira Server 9.4 REST API and did not find anything, and i also checked a few before that, nothing with /labels, thats why i was asking about this “in general”.