Using PHP to pass a redirect url within the hs_context parameter isn’t working. I’m getting a 302 response code and my data is successfully being added to HS but the redirect isn’t working.
I even tested it with my redirect shut off in the form UI in HS.

If you have a redirect URL set up for the form in the UI, it will override this option, even if no redirect URL is included in the form POST. Can you send me a link to the page where this form is?developers.hubspot.com

POST https://forms.hubspot.com/uploads/form/v2/:portal_id/:form_guid - Send form submission data to HubSpot. Form submissions from external sources can be made to any registered HubSpot form. You can see a list of forms on your portal by going to...

Sorry for the delay on this, and thank you for your patience. How are you handling the form submission server side? The redirectUrl just changes the response you see from the HubSpot API; you’ll see a 204 if there’s no redirectUrl in the submission or the UI, and a 302 with a location header (corresponding to the redirectUrl) if there is. How are you handling the response on your server?

I’m not particularly familiar with PHP, so I’m not really the best resource to help debug this script. The 302 response you get from HubSpot should include a location header which will contain the redirect URL. You could also parse the request you get from the client for the redirectUrl parameter and respond accordingly, rather than waiting for the response from HubSpot.