title: API Gateway integration response model template - remove a property
body: <p>I've contacted AWS support and was told that this is currently not possible, however, I struggle to believe that and would like a second opinion. </p>
  
  <p>My situation is this:</p>
  
  <p>I currently have an API and we use model templating on both the requests and responses... Something that looks like this (within the Integration Request):</p>
  
  <pre><code>#set($input = $input.body)
  #set( $newbody = $input.replace("CostRecoveryGUID", 
  "CostRecoveryId").replace("InvoiceItemGUID", "InvoiceItemId"))
  $newbody
  </code></pre>
  
  <p>This returns the model as expected, however, it first replaces a few property names - this works perfectly fine. </p>
  
  <p>I would like to receive the body object (within the response) and remove an entire property from the response. I know this might sound like a weird case and it is, however, this is needed. </p>
  
  <p>So, assuming the same code - I tried something like this:</p>
  
  <pre><code>#set($input = $input.body)
  #set( $newbody = $input.replace("CostRecoveryGUID", 
  "CostRecoveryId").replace("InvoiceItemGUID", 
  "InvoiceItemId").remove("PropertyName"))
  $newbody
  </code></pre>
  
  <p>Which didn't work unfortunately. </p>
  
  <p>I have also tried </p>
  
  <pre><code>#set( $newbody = $newbody.delete("PropertyName") 
  </code></pre>
  
  <p>and a few variations. </p>
  
  <p>Is there anyone else that has a possible solution? </p>
  
  <p>Thanks</p>