39

In AWS API Gateway, is it possible to rename an API instance somehow?

I don't see the option on the UI, but maybe it's possible by using some API call.

6 Answers 6

46

Yes it's available in the API or CLI.

In the API you use a PATCH request on the 'name' field. http://docs.aws.amazon.com/apigateway/api-reference/resource/rest-api/

In the CLI, see docs http://docs.aws.amazon.com/cli/latest/reference/apigateway/update-rest-api.html

The PATCH op is 'replace' and the path would be '/name'

Edit: Thanks @Canotto90 for the example

aws apigateway update-rest-api --rest-api-id IDOfTheAPIThatNeedsTobeUpdated --patch-operations op=replace,path=/name,value=NewName

3
  • 1
    Thanks! Running: aws apigateway update-rest-api --rest-api-id miApiId --patch-operations op=replace,path=/name,value=testName worked. Commented Dec 18, 2015 at 13:05
  • Thank you @canotto90. Saved me some time concocting that command. Commented Aug 1, 2016 at 21:57
  • 2
    Why it's not available in the UI?
    – Defozo
    Commented Dec 27, 2016 at 19:02
22

Here is how you can get the list of APIs and their IDs:

aws apigateway get-rest-apis

Use the Id to update name of API as mentioned by Canotto90 above:

aws apigateway update-rest-api --rest-api-id IDOfTheAPIThatNeedsTobeUpdated --patch-operations op=replace,path=/name,value=NewName
16

It turns out, there is now a way to rename the API!

Under the Amazon API Gateway service, select APIs. You will see the list of your APIs.

List of APIs

Now, click the little cog wheel in the top right corner of the API that you wish to rename...

cog wheel

Simply change the name, hit save, and you're good!

editing UI

1
  • 2
    Thank god they allowed us to change it in the console Commented Nov 28, 2018 at 9:05
13

From https://console.aws.amazon.com/apigateway -> Select API by Name -> Settings -> General Settings -> Name

4

I know this is an old question, but people may still need an answer as I just did.

Amazon's AWS UI isn't always clear. There is no "Rename" function to change the name of an existing API. However, it can be done by cloning your existing API.

To rename your API, click the "Create API" button and select "Clone from existing API". This will allow you to give it a new name.

1

The latest version of the console allows you to edit the name via the API settings: see where in console here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.