Is it possible to get ALL custom fields in an instance via REST API?

Hi all, first post - good to be here.
I am developing a connect app and would like to get a list of all custom fields in an instance via the REST API. In the documentation (https://developer.atlassian.com/cloud/jira/platform/rest/#api-group-Issue-fields) there is an endpoint “/rest/api/3/field” which claims to return all fields, with some limitations. The biggest limitation that I am concerned about is that the field must be used in a project. I want a list of all fields in the instance without exception - if it exists I wanna know it’s there.

Does anyone have any suggestions? I’m fine with roundabout solutions (not a clean use this 1 endpoint job), or even suggestions of endpoints that might be useful in creating some roundabout solution.

If it matters I am purely interested in Jira Cloud with regards to this question.

Thanks

You can use this API: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-field-get. It returns all fields if you’re querying the API as the add-on user (which is the default in Connect).

Hi David,
Thanks for your response but this endpoint has the same limitations as the one I provided. It does not return fields that are not used in any projects (have no contexts). This is not ideal for my use case - I would like to see all the fields that exist, with no exception.

I see. But why would you have fields with no context? Is this really common?
In any case, this is a limitation of the API and there is no other endpoint that will return this info. You might want to create a bug on ecosystem.atlassian.net

I agree - I do expect it to be very uncommon for instances to have fields with no context.
It would be much desired that my app could detect these fields if they do exist though - it would be a part of its functionality.
Thanks for your suggestions - I will likely raise a bug/feature request for this.