- 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