# "Invalid API identifier specified"

**URL:** <https://forum.serverless.com/t/invalid-api-identifier-specified/8498>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [June 7, 2019, 2:56am UTC](https://forum.serverless.com/t/invalid-api-identifier-specified/8498 "2019-06-07T02:56:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anorman728](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/anorman728/32/3394_2.png) [@anorman728](https://forum.serverless.com/u/anorman728)\
**Post date:** [June 7, 2019, 2:56am UTC](https://forum.serverless.com/t/invalid-api-identifier-specified/8498/1 "2019-06-07T02:56:00Z")

</div>

I’m trying to delete an existing function and create a new one with the same code (config changes had messed up some stuff). I assumed that I’d just delete it from the AWS Console and redeploy, but when I run `serverless deploy --force`, I get back this error-- `Invalid API identifier specified`.

I know that I’ll have to have a different url, and that’s fine because this project isn’t pushed to prod yet for my org, but how can I get this to deploy as if it’s an entirely new project?

---

<div class="post-metadata">

**Author:** ![josephroffey](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/josephroffey/32/3385_2.png) [@josephroffey](https://forum.serverless.com/u/josephroffey)\
**Post date:** [June 7, 2019, 10:00am UTC](https://forum.serverless.com/t/invalid-api-identifier-specified/8498/2 "2019-06-07T10:00:12Z")

</div>

Sounds like an API Gateway error. Have you tried checking the API Gateway to see if there are some API Gateway resources referencing the function you originally deleted?

---

<div class="post-metadata">

**Author:** ![anorman728](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/anorman728/32/3394_2.png) [@anorman728](https://forum.serverless.com/u/anorman728)\
**Post date:** [June 9, 2019, 9:04pm UTC](https://forum.serverless.com/t/invalid-api-identifier-specified/8498/3 "2019-06-09T21:04:31Z")

</div>

Nothing that I can find. I had already deleted what I could find for it.

---

<div class="post-metadata">

**Author:** ![anorman728](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/anorman728/32/3394_2.png) [@anorman728](https://forum.serverless.com/u/anorman728)\
**Post date:** [June 9, 2019, 10:04pm UTC](https://forum.serverless.com/t/invalid-api-identifier-specified/8498/4 "2019-06-09T22:04:49Z")

</div>

Okay, I finally figured it out. In addition to deleting the service and the function from the AWS console, I had to delete the _role_ (but not the user itself) for the function in the IAM users page, then _attempt_ to delete the stack from the CloudFormation page-- That will then give a list of things it was unable to delete, so I had to delete those manually. Then I needed to attempt to delete the stack again, and it was successful. _Then_ I was able to re-deploy again.

---

<div class="post-metadata">

**Author:** ![gauravthantry](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gauravthantry/32/4851_2.png) [@gauravthantry](https://forum.serverless.com/u/gauravthantry)\
**Post date:** [December 9, 2020, 4:28am UTC](https://forum.serverless.com/t/invalid-api-identifier-specified/8498/5 "2020-12-09T04:28:02Z")

</div>

Worked like a charm!!! Thank you
