# Provide SST construct for API Gateway "Integration"

**URL:** <https://discourse.sst.dev/t/provide-sst-construct-for-api-gateway-integration/2699>\
**Category:** General\
**Created:** [June 29, 2022, 1:50am UTC](https://discourse.sst.dev/t/provide-sst-construct-for-api-gateway-integration/2699 "2022-06-29T01:50:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![willjstevens](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/willjstevens/32/487_2.png) [@willjstevens](https://discourse.sst.dev/u/willjstevens)\
**Post date:** [June 29, 2022, 1:50am UTC](https://discourse.sst.dev/t/provide-sst-construct-for-api-gateway-integration/2699/1 "2022-06-29T01:50:42Z")

</div>

Continuing the discussion from [Mapping Cognito Identity Id and User Pool Id](https://discourse.sst.dev/t/mapping-cognito-identity-id-and-user-pool-id/500/11):

Given the use case in the cited comment above, it would be extremely helpful to provide a construct feature in the [Api construct](https://docs.sst.dev/constructs/Api#addroutes) to provide _Integrations_ for endpoint methods. I would expect this to be either a feature in the SST constructs directly or, a ‘pass-through’ feature to CDK to do this.

As an example, I would expect it to work like this in my ApiStack.js file.

> const api = new Api(stack, “Api”, {  
> …  
> routes: {  
> “GET /notes/{id}”: “functions/get.main”,  
> “POST /notes”: {  
> function: “functions/create.main”,  
> **cdk: {**  
> **integration: {  
> parameterMapping: new ParameterMapping().overwriteHeader(“sub”, MappingValue.contextVariable(“$context.identity.cognitoAuthenticationProvider”))**  
> }  
> …

Can you provide this or some kind of CDK hook? Nice ‘[create sst](https://www.youtube.com/watch?v=wBTDkLIyMhw)’ stream today BTW.
