Creating Document from Template with Zoho Sign API

Creating Document from Template with Zoho Sign API

Hello, I am using Zoho Sign API to create documents from a Template. I'm able to talk to the /createdocument endpoint and it appears to accept my field_data. However, it is not accepting my actions array. It says that there is an actions array size mismatch, but I have confirmed that the template has two actions (company signature and consultant signature), and I am passing it an array of two actions. See below.

    url = f"https://sign.zoho.com/api/v1/templates/{template_id}/createdocument"
    headers = {
        "Authorization": f"Zoho-oauthtoken {access_token}",
        "Content-Type": "application/json"
    }

    # TODO: have this automatically iterate through the document_data keys and values (rather than hardcode)
    payload = {
        "templates": {
            "field_data" : {
                "field_text_data" : {
                    "contract_number": document_data.get("contract_number", {}),
                    "sow_number": document_data.get("sow_number", {})
                },
                "field_boolean_data" : {},
                "field_date_data" : {
                    "effective_date": document_data.get("effective_date", {}),
                    "start_date": document_data.get("start_date", {}),
                    "end_date": document_data.get("end_date", {}),
                    "sow_effective_date": document_data.get("sow_effective_date", {})
                    }
            },
            "actions": [
                {
                    "action_id": "1",
                    "role": "Company",
                    "recipient_email": "test@mosaicdesignlabs.com",
                    "recipient_name": "Frankie Myers",
                    "verify_recipient": False
                },
                {
                    "action_id": "2",
                    "role": "Consultant",
                    "recipient_email": "test2@mosaicdesignlabs.com",
                    "recipient_name": "test name",
                    "verify_recipient": False
                }
            ],
            "notes": "A contract for your review from Mosaic Engineering, LLC"
        }
    }

I get the following error message when I run this command:
{'code': 9056, 'message': 'Action array size mismatch from the templates', 'status': 'failure'}

I have verified that my template has two actions (both in the Zoho Sign web user interface and in the exported JSON of the template):