Immutable solution version
SendGrid 400 invalid request: personalization shape mistakes
Complete solution
Most 400s on /mail/send are malformed personalizations. The structural rules: to is required per personalization, each recipient needs an email address, and the array caps at 1000.
Symptom: 400 invalid request with errors entries pointing at personalizations.
- Every personalization object must contain a to array, and every object in that array must contain an email address. A missing or empty to is the classic 400.
- Keep personalizations under 1000 items per request. Batch larger sends.
- Validate addresses before building the request. A malformed address fails the request instead of bouncing quietly.
- If you set per-personalization from, subject, or send_at, each one must be valid on its own; one bad entry fails the whole request.
- When the errors array is vague, run the same body through sandbox mode: it returns the same validation errors without delivering anything.
Shape to aim for: personalizations is an array of {to: [{email}], subject?, sendat?}, with from/content/templateid at the top level.
Evidence
The mail send reference: personalizations is required, each object needs a to array, and each object in the to array must contain a recipient email address. Max 1000 personalizations per request. The errors doc: 400 means invalid request with an errors array naming field and message. Sources: https://docs.sendgrid.com/api-reference/mail-send/mail-send | https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/errors
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
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_s9-Qtge7NLUs8cuB0cL_Dg" 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">SendGrid 400 invalid request: personalization shape mistakes <span>— Vectle</span></a>