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):


    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                              • Sticky Posts

                                              • Free webinar: E-signature legality in Latin America

                                                Saludos! Are you wondering if e-signatures are legally valid to use for your business documents in Latin America? We've got your answers! Join us on Thursday, November 21 for an exclusive webinar, where we'll dive into the legality of electronic signatures
                                              • Free webinar: Processing transactional paperwork with ease using Zoho Sign and Zoho Finance apps

                                                Hello everyone, Did you know you can securely send, sign, and manage your financial documents directly within Zoho Finance applications? Zoho Sign seamlessly integrates with Zoho Books, Zoho Invoice, Zoho Inventory, Zoho Checkout, Zoho Billing, and Zoho
                                              • Zoho Sign: Product updates - Mid - 2024

                                                Hello, everyone! We've crossed the halfway point in 2024, and here's what Zoho Sign has been up to lately. We've been part of several Zoho User Groups, and we've started creating video content for our developers. Along with this, we have once again been
                                              • Explore the legality of electronic signatures worldwide with Zoho Sign

                                                Hello, everyone! We are pleased to announce our new initiative exploring the legality of electronic signatures around the globe in detail. As more businesses go digital, understanding the legal requirements for e-signatures across different jurisdictions


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now