# Use an alias to access the MASTER ref with the REST API

**URL:** <https://community.prismic.io/t/use-an-alias-to-access-the-master-ref-with-the-rest-api/3772>\
**Category:** Developing with Prismic\
**Tags:** product-feature-idea, rest-api\
**Created:** [January 28, 2021, 1:28pm UTC](https://community.prismic.io/t/use-an-alias-to-access-the-master-ref-with-the-rest-api/3772 "2021-01-28T13:28:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![florian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/florian/32/1369_2.png) [@florian](https://community.prismic.io/u/florian)\
**Post date:** [January 28, 2021, 1:28pm UTC](https://community.prismic.io/t/use-an-alias-to-access-the-master-ref-with-the-rest-api/3772/1 "2021-01-28T13:28:13Z")

</div>

Hi there,

I've found a couple answers online, but nothing official I believe. I'm using prismic's REST API to fetch some data from our public master version (security is set to "Public API for Master only"), and you need to pass in a ref to master, which appears to be changing every time we do a release.

I saw some people recommend you always do a first query to `/api` and get the ref from there, but that requires an extra back-and-forth to prismic, which is wasted time for us, as we use the data to render a client-side page, and that makes the data appear late.

I was wondering whether simply using an alias, that dynamically points to the master ref on prismic's backend was something that was being considered?

Simply being able to do `ref=MASTER_REF` would be very helpful.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [January 29, 2021, 12:18am UTC](https://community.prismic.io/t/use-an-alias-to-access-the-master-ref-with-the-rest-api/3772/2 "2021-01-29T00:18:43Z")

</div>

Hey Florian, at the moment, the solution you mentioned is the correct one to get the ref of your response.

Doing a query to your endpoint CDN gives you access to the ref, like so:

`https://your-repo-name.cdn.prismic.io/api/v2`

I will mark your thread as a feature request to be aware of your suggestion.

Thanks

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [February 4, 2021, 10:06pm UTC](https://community.prismic.io/t/use-an-alias-to-access-the-master-ref-with-the-rest-api/3772/4 "2021-02-04T22:06:51Z")

</div>

This issue has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 4:44pm UTC](https://community.prismic.io/t/use-an-alias-to-access-the-master-ref-with-the-rest-api/3772/6 "2021-12-09T16:44:10Z")

</div>


