SendGrid · api · fg-0535
SendGrid 400 'All values of custom arguments object must be strings' when passing an ID or flag
400 Bad Request: All values of custom arguments object must be strings
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
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;
Affects: SendGrid v3 Mail Send, as of 2026-10
Sources
- https://www.twilio.com/docs/sendgrid/api-reference/mail-send/errors
- https://www.twilio.com/docs/sendgrid/for-developers/sending-email/unique-arguments
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp