# Use different backends enpoints for deploy-previews

**URL:** <https://answers.netlify.com/t/use-different-backends-enpoints-for-deploy-previews/54820>\
**Category:** Support\
**Tags:** deploy-previews, environment-vars, deployment\
**Created:** [April 11, 2022, 3:44pm UTC](https://answers.netlify.com/t/use-different-backends-enpoints-for-deploy-previews/54820 "2022-04-11T15:44:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nils](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nils/32/36104_2.png) [@Nils](https://answers.netlify.com/u/Nils)\
**Post date:** [April 11, 2022, 3:44pm UTC](https://answers.netlify.com/t/use-different-backends-enpoints-for-deploy-previews/54820/1 "2022-04-11T15:44:50Z")

</div>

Hi,

We have a netlify site running on this domain:  
[app.staging.ramify.fr](https://app.staging.ramify.fr/)

We also have a backend hosted on heroku.  
For every new pull request on github, we have a feature that deploy a preview backend and make it accessible through an endpoint like app-preview-{{PR-number}}.ramify.fr

We would like to use those endpoints for our deploy-previews on netlify.  
For now, our backend endpoint is defined as an environment variable, and we would like it to change for every deploy-preview to something like: app-preview-{{PR-number}}.ramify.fr

I couldn’t find a way to have a dynamic variable that depend on the pull request name / number.

What could be a way to do this?

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [April 14, 2022, 2:58pm UTC](https://answers.netlify.com/t/use-different-backends-enpoints-for-deploy-previews/54820/4 "2022-04-14T14:58:08Z")

</div>

Hey there, @Nils 👋

Have you tried using **`REVIEW_ID`**? You can read more about all of our environment variables in our Docs: [Build environment variables | Netlify Docs](https://docs.netlify.com/configure-builds/environment-variables/#deploy-urls-and-metadata)

If this doesn’t help, can you please walk me through your use case in a bit more detail? This way I can look into it further for you.

---

<div class="post-metadata">

**Author:** ![Nils](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nils/32/36104_2.png) [@Nils](https://answers.netlify.com/u/Nils)\
**Post date:** [April 14, 2022, 6:43pm UTC](https://answers.netlify.com/t/use-different-backends-enpoints-for-deploy-previews/54820/5 "2022-04-14T18:43:01Z")

</div>

Hey @hillary,

Thanks for your clear answer, it should do the trick.

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [April 14, 2022, 6:55pm UTC](https://answers.netlify.com/t/use-different-backends-enpoints-for-deploy-previews/54820/6 "2022-04-14T18:55:16Z")

</div>

Glad this got you on the right track! Happy building 🚀
