Finally got it with the following mapping template
#set($inputBody = $util.parseJson($input.body))
#set($headerValue = $input.params().header.get("X-Project-Id"))
#set($messagePayload = '{ "body":'+$input.body+', "projectId":"'+$headerValue+'"}')
Action=SendMessage&MessageBody=$util.urlEncode($messagePayload)