> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Sign Request with Sign Template

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const [localizedHref, setLocalizedHref] = useState(href);
  const supportedLocales = useMemo(() => ['ja'], []);
  useEffect(() => {
    const getLocaleFromPath = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      if (match) {
        const potentialLocale = match[1];
        if (supportedLocales.includes(potentialLocale)) {
          return potentialLocale;
        }
      }
      return null;
    };
    const hasLocalePrefix = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      return match ? supportedLocales.includes(match[1]) : false;
    };
    const currentPath = window.location.pathname;
    const currentLocale = getLocaleFromPath(currentPath);
    if (href && href.startsWith('/') && !hasLocalePrefix(href)) {
      if (currentLocale) {
        setLocalizedHref(`/${currentLocale}${href}`);
      } else {
        setLocalizedHref(href);
      }
    } else {
      setLocalizedHref(href);
    }
  }, [href, supportedLocales]);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

The Sign Request API allows you to use a predefined Box Sign
template when creating a sign request.
The template includes placeholders
that are automatically populated with data
when creating the request.

## Create Template

Start with creating a Box Sign template
that includes `text`, `date`,
and `signature` fields you will need for
you request.

See the [template guides][docuprep] guide
for detailed instructions.

## Get the Template ID

To send a sign request, you need to pass the ID
of the template you want to use.
List the templates to find the `template_id`.

```json  theme={null}
"entries": [
  {
    "id": "6ae28666-03c4-4ac1-80db-06a90d3b1361",
    "name": "Contract.pdf",
    "parent_folder": {
      "id": "157064745449",
      "etag": "0",
      "type": "folder",
      "sequence_id": "0",
      "name": "My Sign Requests"
    },
    "source_files": [
      {
        "id": "1216382236853",
        "etag": "0",
        "type": "file",
        "sequence_id": "0",
        "sha1": "ca9c75cda0d5e3c3c9b0a1e6d42cb5e29a211ab6",
        "file_version": {
          "id": "1327286673653",
          "type": "file_version",
          "sha1": "ca9c75cda0d5e3c3c9b0a1e6d42cb5e29a211ab6"
        }
      }
    ],
    "signers": [
      {
        "email": "",
        "label": "reader",
        "public_id": "4Z8QZZV4",
        "role": "final_copy_reader",
        "is_in_person": false,
        "order": 1,
        "inputs": [...]
      },
      {
        "email": "",
        "label": "signer1",
        "public_id": "4Z8QZZV4",
        "role": "signer",
        "is_in_person": false,
        "order": 1,
        "inputs": [...]
      },
      {
        "email": "",
        "label": "signer2",
        "public_id": "13VK8794",
        "role": "signer",
        "is_in_person": false,
        "order": 1,
        "inputs": [
          {
            "document_tag_id": "signer2_full_name",
            "id": "da431975-55c5-4629-86ae-3fb12dda1386",
            "type": "text",
            "text_value": null,
            "is_required": true,
            "content_type": "full_name",
            ...
          },
          {
            "document_tag_id": null,
            "id": "b5a76a22-8d48-456e-a012-22a12fc91eb7",
            "type": "signature",
            ...
          },
          {
            "document_tag_id": null,
            "id": "7e0cc4ee-b878-4739-afde-acbf69b117b2",
            "type": "date",
            "date_value": null,
            ...
          }
        ],
      }
    ]
    ...
  }
]
```

The response is similar to the following one
(abbreviated for guide purposes).
For the full response example, see
<Link href="/reference/get-sign-templates#response-example">Box Sign template API</Link>.

You can also learn more about the specific
parameters in the <Link href="/reference/post-sign-requests">Create Sign Request</Link> guide.

```json  theme={null}
"entries": [
  {
    "id": "6ae28666-03c4-4ac1-80db-06a90d3b1361",
    "name": "Contract.pdf",
    "parent_folder": {
      "id": "157064745449",
      "etag": "0",
      "type": "folder",
      "sequence_id": "0",
      "name": "My Sign Requests"
    },
    "source_files": [
      {
        "id": "1216382236853",
        "etag": "0",
        "type": "file",
        "sequence_id": "0",
        "sha1": "ca9c75cda0d5e3c3c9b0a1e6d42cb5e29a211ab6",
        "file_version": {
          "id": "1327286673653",
          "type": "file_version",
          "sha1": "ca9c75cda0d5e3c3c9b0a1e6d42cb5e29a211ab6"
        }
      }
    ],
    "signers": [
      {
        "email": "",
        "label": "reader",
        "public_id": "4Z8QZZV4",
        "role": "final_copy_reader",
        "is_in_person": false,
        "order": 1,
        "inputs": [...]
      },
      {
        "email": "",
        "label": "signer1",
        "public_id": "4Z8QZZV4",
        "role": "signer",
        "is_in_person": false,
        "order": 1,
        "inputs": [...]
      },
      {
        "email": "",
        "label": "signer2",
        "public_id": "13VK8794",
        "role": "signer",
        "is_in_person": false,
        "order": 1,
        "inputs": [
          {
            "document_tag_id": "signer2_full_name",
            "id": "da431975-55c5-4629-86ae-3fb12dda1386",
            "type": "text",
            "text_value": null,
            "is_required": true,
            "content_type": "full_name",
            ...
          },
          {
            "document_tag_id": null,
            "id": "b5a76a22-8d48-456e-a012-22a12fc91eb7",
            "type": "signature",
            ...
          },
          {
            "document_tag_id": null,
            "id": "7e0cc4ee-b878-4739-afde-acbf69b117b2",
            "type": "date",
            "date_value": null,
            ...
          }
        ],
      }
    ]
    ...
  }
]
```

## Create the sign request

Follow these steps to <Link href="/reference/post-sign-requests">create sign request</Link> using a template:

1. In the request body, provide the `template_id`:

   ```json  theme={null}
   {
     "template_id": "6ae28666-03c4-4ac1-80db-06a90d3b1361",
     "parent_folder": {
       "id": "123456789",
       "etag": "0",
       "type": "folder",
       "sequence_id": "0",
       "name": "My Sign Requests"
     },
     ...
   }
   ```

2. Add the signer email addresses and roles:

   ```json  theme={null}
   {
     "template_id": "6ae28666-03c4-4ac1-80db-06a90d3b1361",
     "parent_folder": {
       "id": "157064745449",
       "etag": "0",
       "type": "folder",
       "sequence_id": "0",
       "name": "My Sign Requests"
     },
     "signers": [
       {
         "email": "signer1@sample.com",
         "role": "signer"
       },
       {
         "email": "signer2@sample.com",
         "role": "signer"
       }
     ]
   }
   ```

3. Add the `prefill_tags` to populate the fields.

   <Info>
     Make sure the signer order is the same as the one
     displayed on the template. If the template had `signer1`
     first and then `signer2`, the `POST` request must reflect
     the same order to assign the proper signers.
   </Info>

   ```json  theme={null}
   {
     "template_id": "6ae28666-03c4-4ac1-80db-06a90d3b1361",
     "parent_folder": {
       "id": "123456789000",
       "etag": "0",
       "type": "folder",
       "sequence_id": "0",
       "name": "My Sign Requests"
     },
     "signers": [
       {
         "email": "signer1@sample.com",
         "role": "signer"
       },
       {
         "email": "signer2@sample.com",
         "role": "signer"
       }
     ],
     "prefill_tags": [
       {
         "document_tag_id": "signer1_full_name",
         "text_value": "Aaron Levie"
       },
       {
         "document_tag_id": "signer2_full_name",
         "text_value": "Albert Einstein"
       }
     ]
   }
   ```

4. Send the `POST` request. The response will be similar to the following:

   ```json  theme={null}
   {
     "is_document_preparation_needed": false,
     ...
     "signers": [
       {
         "email": "reader@sample.com",
         "role": "final_copy_reader",
       },
       {
         "email": "signer1@sample.com",
         "role": "signer",
       },
       {
         "email": "signer2@sample.com",
         "role": "signer",
       }
     ],
     "id": "d02fefd2-15fa-431f-a127-2b4525616ae6",
     "prefill_tags": [
       {
         "document_tag_id": "signer1_full_name",
         "text_value": "Aaron Levie",
       },
       {
         "document_tag_id": "signer2_full_name",
         "text_value": "Albert Einstein",
       }
     ],
     "source_files": [],
     "parent_folder": {
       "id": "123456789000",
       "type": "folder",
       "name": "My Sign Requests"
     },
     "name": "Contract.pdf",
     "type": "sign-request",
     "status": "created",
     "sign_files": {
       "files": [
         {
           "id": "123456789",
           "type": "file",
           "name": "Contract.pdf",
         }
       ],
       "is_ready_for_download": true
     },
     "template_id": "6ae28666-03c4-4ac1-80db-06a90d3b1361"
   }
   ```

[docuprep]: https://support.box.com/hc/en-us/articles/4404094944915-Creating-templates

[parentfolder]: /guides/box-sign/create-sign-request#parent-folder

[signers]: /guides/box-sign/create-sign-request#signers

<RelatedLinks
  title="RELATED APIS"
  items={[
  { label: "List Box Sign templates", href: "/reference/get-sign-templates", badge: "GET" },
  { label: "Get Box Sign template by ID", href: "/reference/get-sign-templates-id", badge: "GET" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
  { label: "Create Box Sign Request", href: "/guides/box-sign/create-sign-request", badge: "GUIDE" }
]}
/>
