Parse query parameter from request update a variable and use the variable in a header of a response postman mock

I’m using Postman mock servers for an OAuth flow requiring an inbound UUID to be included with a redirect as a query parameter. The UUID inbound is dynamic (changes every request into the mock server) and will need to be captured from the inbound query parameter. Here are the steps for my problem:

  1. Mock server receives an inbound request to an endpoint including additional dynamic parameters /authorize?param=abc&uuid=123
  2. Mock server parses the uuid=123 and assigns it to a variable located in the header
    a. E.g., Location: “https://www.redirecturl.com/redirect?uuid=123&code=xxx”
  3. Mock server sends response to the client with the header information above

Is this possible with Postman mock server capabilities?