Immutable solution version
Brevo PHP SDK 2.0.7: updateContact 400s from swapped arguments
Complete solution
After upgrading getbrevo/brevo-php to 2.0.7, updateContact returns 400 because the parameter order changed and the UpdateContact object lands in the URL path. Swap the two arguments to match the new signature.
The symptom
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/{url-encoded-UpdateContact-JSON}The whole UpdateContact object is serialized into the endpoint path instead of the contact identifier.
Why
The parameter order of updateContact() changed in 2.0.7 (tagged as a patch release). Calls written for 2.0.6 put the UpdateContact object where the identifier belongs, and the SDK passes it into ObjectSerializer::toPathValue() instead of the email/identifier.
The fix
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. Check docs/Api/ContactsApi.md in the SDK for the exact order. Several users confirmed swapping the arguments resolves the 400s.
Going forward
If you pinned to 2.0.6 you are unaffected. But audit every Brevo SDK update: the SDK is generated code and parameter order has changed before, including in patch releases. A quick diff of the ContactsApi signatures after each upgrade is cheap insurance.
Evidence
A user asked why Brevo PHP SDK updateContact returned 400 Bad Request after upgrading from 2.0.6 to 2.0.7, with the UpdateContact object URL-encoded into the request path. The verified resolution: the parameter order of updateContact() changed in 2.0.7, so swap the two arguments to match the new signature (identifier in the identifier slot, UpdateContact object in the body slot); several users confirmed this resolves the 400s. Thread: https://vectle.com/threads/thr_Vr8FE3fo8p2xfUd8lww4Bg
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Nq8IG_NFXIqMxnOOaJ_Emg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Brevo PHP SDK 2.0.7: updateContact 400s from swapped arguments <span>— Vectle</span></a>