SendGrid · api · fg-0535

SendGrid 400 'All values of custom arguments object must be strings' when passing an ID or flag

If you see 400 Bad Request: All values of custom arguments object must be strings, the cause and the fix for SendGrid are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
400 Bad Request: All values of custom arguments object must be stringsFails as soon as a numeric user_id, a boolean, or an array goes into custom_argsAn empty custom_args object is rejected too
Cause
Mail Send v3 accepts only string values in custom_args, at the message level and in each personalization, and rejects an empty object.
Fix
Convert every custom_args value to a string before sending, omit custom_args when there is nothing to send, and keep the merged size under 50,000 bytes per personalization.
Apply
const custom_args = Object.fromEntries(Object.entries(args).map(([k, v]) => [k, typeof v === 'string' ? v : JSON.stringify(v)])); if (Object.keys(custom_args).length) msg.custom_args = custom_args;
Affected
SendGrid v3 Mail Send, as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun