# Returning a 201 with serverless 1.x

**URL:** https://forum.serverless.com/t/returning-a-201-with-serverless-1-x/441
**Category:** Serverless Framework
**Created:** [October 4, 2016, 5:23am UTC](https://forum.serverless.com/t/returning-a-201-with-serverless-1-x/441 "2016-10-04T05:23:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![stew](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/stew/32/176_2.png) [@stew](https://forum.serverless.com/u/stew)
#### Post date: [October 4, 2016, 5:23am UTC](https://forum.serverless.com/t/returning-a-201-with-serverless-1-x/441/1 "2016-10-04T05:23:00Z")

</div>

Is there a way to specify a 201 response code instead of a 200 for certain endpoints?

Based on the guide ([https://github.com/serverless/serverless/blob/master/docs/02-providers/aws/events/01-apigateway.md](https://github.com/serverless/serverless/blob/master/docs/02-providers/aws/events/01-apigateway.md)), it seems like this should be possible, but looking at the underlying code, it looks like the 200 response mapping is hard coded ([https://github.com/serverless/serverless/blob/e4846edb21559d56104be678b1099b55f61f003d/lib/plugins/aws/deploy/compile/events/apiGateway/lib/methods.js#L272](https://github.com/serverless/serverless/blob/e4846edb21559d56104be678b1099b55f61f003d/lib/plugins/aws/deploy/compile/events/apiGateway/lib/methods.js#L272)).

I was expecting to be able to do something like:

```auto
myEvent:
    handler: myEvent.handler
    events:
      - http:
          path: path/to/myEvent
          method: put
          response:
            headers:
              Content-Type: "'text/html'"
            template: $input.path('$')
            statusCodes:
              201:
                pattern: ''

```

Is this at all possible or should I just wait for the new HTTP response support via the Lambda proxy integration? ([https://github.com/serverless/serverless/pull/2185](https://github.com/serverless/serverless/pull/2185))

---

<div class="post-metadata">

### Author: ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)
#### Post date: [October 10, 2016, 10:13am UTC](https://forum.serverless.com/t/returning-a-201-with-serverless-1-x/441/2 "2016-10-10T10:13:54Z")

</div>

When I looked at the source I also concluded that the 200 response was hard coded. Have a look at [https://github.com/silvermine/serverless-plugin-multiple-responses](https://github.com/silvermine/serverless-plugin-multiple-responses) as it might help you for now.

---

<div class="post-metadata">

### Author: ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)
#### Post date: [October 10, 2016, 11:39am UTC](https://forum.serverless.com/t/returning-a-201-with-serverless-1-x/441/3 "2016-10-10T11:39:33Z")

</div>

It looks like the master branch now has support for the lambda-proxy integration type. If you don’t mind your Lambda understanding HTTP then you can use that to send back a 201 🙂

---

<div class="post-metadata">

### Author: ![stew](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/stew/32/176_2.png) [@stew](https://forum.serverless.com/u/stew)
#### Post date: [October 10, 2016, 10:59pm UTC](https://forum.serverless.com/t/returning-a-201-with-serverless-1-x/441/4 "2016-10-10T22:59:13Z")

</div>

Yeah my preference is to use the new lambda-proxy integration. Now that’s in master, I assume it’ll be a part of the next release candidate, so I’ll pick it up then.

---

<div class="post-metadata">

### Author: ![flomotlik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/flomotlik/32/3_2.png) [@flomotlik](https://forum.serverless.com/u/flomotlik)
#### Post date: [October 12, 2016, 2:48pm UTC](https://forum.serverless.com/t/returning-a-201-with-serverless-1-x/441/5 "2016-10-12T14:48:21Z")

</div>

The master has now been released as 1.0 so you’re good to go with the proxy
