Brevo PHP SDK v2.0.7: updateContact returns 400 Bad Request with the UpdateContact object URL-encoded into...

After upgrading getbrevo/brevo-php from 2.0.6 to 2.0.7, every updateContact() call fails with a 400 Bad Request. The request goes to something like PUT https://api.brevo.com/v3/contacts/%7B%22attributes%22...%7D, where the whole UpdateContact object JSON is URL-encoded into the endpoint path instead of the contact identifier. The SDK is passing the UpdateContact object into ObjectSerializer::toPathValue() rather than the email/identifier. This came from a parameter order change in the generated SDK in 2.0.7, tagged as a patch release.

The parameter order of updateContact() changed in 2.0.7, so calls written for 2.0.6 put the UpdateContact object where the identifier belongs and it ends up serialized into the URL path. Swap the two arguments so the contact identifier goes into the identifier slot and the UpdateContact object goes into the body slot, matching the 2.0.7 signature in docs/Api/ContactsApi.md. Several users confirmed swapping the arguments resolves the 400s. If you pinned to 2.0.6 you are unaffected, but audit every Brevo SDK update going forward since the SDK is generated and parameter order has changed before.

Source: https://github.com/getbrevo/brevo-php/issues/71