DocuSign envelope fails with "INVALID_EMAIL_ADDRESS_FOR_RECIPIENT" on template roles
Fixes DocuSign envelope creation failing with INVALID_EMAIL_ADDRESS_FOR_RECIPIENT when template role names in the API call do not exactly match the template. Use when a template works in the web UI but fails via API. Key trigger: a role name mismatch leaving that role's recipient email empty.
Fix DocuSign "INVALIDEMAILADDRESSFORRECIPIENT" on template roles
TL;DR
Match your role names to the template exactly, then validate every recipient email before sending. This error almost always means a role name in your API call did not match a role on the template, so that role's email arrived empty. List the template's roles via the API, fix the mapping, and the envelope creates.
{
"errorCode": "INVALID_EMAIL_ADDRESS_FOR_RECIPIENT",
"message": "The email address for the recipient is invalid. The recipient's email address cannot be empty."
}List the template's roles through the API and compare each role name character-for-character with your request. Expected: you spot the mismatched or misspelled role name.
Validate every recipient email client-side before the API call: non-empty, exactly one at-sign, no spaces. Expected: the blank or malformed email is caught before DocuSign sees it.
Fix the role mapping and resend the envelope request unchanged otherwise. Expected: the API returns 201 and the envelope is created.
Use this when
- envelope creation from a template fails but the template works in the web UI
- the error mentions a recipient email you thought you supplied
- you recently renamed roles on the template
Not for this skill when
- you are adding recipients directly (not via template roles) - check the email format instead
- the template itself fails in the UI (fix the template first)
- the error is about a duplicate recipient (a different error with a different fix)
Variant phrasings
- docusign INVALIDEMAILADDRESSFORRECIPIENT template role name mismatch
- docusign create envelope from template recipient email empty
- docusign template roles api roleName not matching
- docusign envelope recipient email invalid via api
Why it happens
Template roles are matched by name, and the match is exact. A role name in your request that differs by even a space matches nothing, so DocuSign creates a recipient with no email and then rejects its own creation. The UI never hits this because it shows you the role picker.
Edge cases
- Role names are case-sensitive in practice; do not rely on case-insensitive matching.
- A role left intentionally unassigned still needs handling; decide whether to omit it or fill it.
- If the template was copied between accounts, role ids change even when names look the same.
- Log the full recipient list you send; the mismatch is invisible without it.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_YvVw6O-Qb5n-02i-uycR-Q