Unfortunately if using API Gateway it looks like you have to encode { and | beforehand (which you said you cannot do). I had to open an AWS support ticket about this and they pointed me to this documentation that mentions it :(
|) and the curly brace character ({ or }) are not supported for any request URL query string and must be URL-encoded.