# Setup different APIs per stage

**URL:** https://forum.serverless.com/t/setup-different-apis-per-stage/9869
**Category:** Serverless Framework
**Tags:** aws, release, lambda, api-gateway
**Created:** [November 15, 2019, 12:39pm UTC](https://forum.serverless.com/t/setup-different-apis-per-stage/9869 "2019-11-15T12:39:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cpritch](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/cpritch/32/3767_2.png) [@cpritch](https://forum.serverless.com/u/cpritch)
#### Post date: [November 15, 2019, 12:39pm UTC](https://forum.serverless.com/t/setup-different-apis-per-stage/9869/1 "2019-11-15T12:39:59Z")

</div>

How do I setup my serverless.yml to deploy to different APIs depending on the stage?

Basically I want this…  
`https://xyz67890.execute-api.us-east-1.amazonaws.com/dev`  
`https://efg45678.execute-api.us-east-1.amazonaws.com/staging`  
`https://abc12345.execute-api.us-east-1.amazonaws.com/prod`

Not this…  
`https://abc12345.execute-api.us-east-1.amazonaws.com/dev`  
`https://abc12345.execute-api.us-east-1.amazonaws.com/staging`  
`https://abc12345.execute-api.us-east-1.amazonaws.com/prod`

The reason is when I deploy a new stage, the previous stage is replaced. For example, if the API DEV is currently deployed, when I deploy STAGING, DEV is replaced and I can’t access it anymore. Although, I can access STAGING now. I need to always have access to each stage. Perhaps I need a different solution?

I’m specifically looking at the “Separate APIs for each stage” section of the following guide: [https://serverless-stack.com/chapters/stages-in-serverless-framework.html](https://serverless-stack.com/chapters/stages-in-serverless-framework.html)

---

<div class="post-metadata">

### Author: ![DataWearsAHood](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/datawearsahood/32/4331_2.png) [@DataWearsAHood](https://forum.serverless.com/u/DataWearsAHood)
#### Post date: [November 17, 2019, 1:55am UTC](https://forum.serverless.com/t/setup-different-apis-per-stage/9869/2 "2019-11-17T01:55:57Z")

</div>

maybe you can try to have 3 folders (1/stage) all syncing to [branches of] the same repo?  
Mote hackily, maybe renaming the serverless folder in your service directory - isn’t that where serverless ‘remembers’ to which stack the service is deployed?
