Mapping Lambda output to API Gateway header

Actually, it seems you can access to all the headers provided by the original response (if it contains a Content-type, then you can type : integration.response.header.Content-type). However, I have not find out any way to add a new header (except statically).


As of today (January 2016), it works by simply specifying integration.response.body.Location in your case.


Today (12th, November, 2015), I was looking for how to pass the Location header from my backend API to a Location header in integration response.

This configuration worked and I could get Location header from backend api:

enter image description here

Looks like the solution proposed by Tobias is possible currently. However, the Location header points to the backend API and this is not what we want. I'll try to find a solution for this and post it here.


From the AWS developer forums today (25 September 2015) this isn't possible yet, but may be coming in the future:

API Gateway does not currently support mapping from the integration response body to the response headers, but we are looking to add support for this in the future.

Forum post here

Edit December 2015: Feature as been added according to a post by an AWS employee in the thread linked above. Thanks to Peter Fox for pointing that out.