# Send Document Using Template — BoldSign

> Send documents for e-signature using a BoldSign template. See the documentation

- Key: `boldsign-send-document-template`
- Type: Action (Write)
- Version: 0.1.3
- App: BoldSign (`boldsign`) — https://pipedream.com/apps/boldsign.md
- This page (HTML): https://pipedream.com/apps/boldsign/actions/send-document-template
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/boldsign/actions/send-document-template/send-document-template.mjs

## Description

Send documents for e-signature using a BoldSign template. [See the documentation](https://developers.boldsign.com/documents/send-document-from-template/?region=us)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `templateId` | `string` | Yes | The ID of the BoldSign template to use. Options are loaded from the connected account. |
| `title` | `string` | No | The title of the document. |
| `message` | `string` | No | A message to include with the document. |
| `roles` | `string[]` | Yes | A role is simply a placeholder for a real person. For example, if we have a purchase order that will always be signed by two people, one from the company and one from the customer, we can create a template with two roles Customer and Representative. Example: [{"roleIndex": 50,"signerName": "Richard","signerOrder": 1,"signerEmail": "richard@cubeflakes.com","privateMessage": "Please check and sign the document.","authenticationCode": "281028","enableEmailOTP": false,"signerType": "Signer","signerRole": "Manager","formFields": [{"id": "SignField","fieldType": "Signature","pageNumber": 1,"bounds": {"x": 100,"y": 100,"width": 100,"height": 50},"isRequired": true}]. |
| `brandId` | `string` | No | The brand ID for customizing the document. Options are loaded from the connected account. |
| `labels` | `string[]` | No | Labels for categorizing documents. |
| `disableEmails` | `boolean` | No | Disable sending emails to recipients. |
| `disableSMS` | `boolean` | No | Disable sending SMS to recipients. |
| `hideDocumentId` | `boolean` | No | Decides whether the document ID should be hidden or not. |
| `enableAutoReminder` | `boolean` | No | Enable automatic reminders. |
| `reminderDays` | `integer` | No | Number of days between reminders. |
| `reminderCount` | `integer` | No | Number of reminder attempts. |
| `cc` | `string[]` | No | A list of CC recipients for the document. Options are loaded from the connected account. |
| `expiryDays` | `integer` | No | Number of days before document expires. |
| `enablePrintAndSign` | `boolean` | No | Allow signers to print and sign document. |
| `enableReassign` | `boolean` | No | Allow signers to reassign the document. |
| `enableSigningOrder` | `boolean` | No | Enable signing order for the document. |
| `disableExpiryAlert` | `boolean` | No | Disable alerts before document expiry. |
| `documentInfo` | `string[]` | No | Custom information fields for the document. See the documentation for further information. |
| `roleRemovalIndices` | `integer[]` | No | Removes the roles present in the template with their indices given in this property. |
| `documentDownloadOption` | `string` | No | Option for document download configuration. |
| `formGroups` | `string[]` | No | Manages the rules and configuration of grouped form fields. See the documentation for further information. |
| `files` | `string[]` | No | The files to upload. For each entry, provide either a file URL or path to a file in the /tmp directory (for example, /tmp/myFile.txt) |
| `fileUrls` | `string[]` | No | URLs of files to include in the document. |
| `recipientNotificationSettings` | `object` | No | Settings for recipient notifications. See the documentation for further information. |
| `removeFormfields` | `string[]` | No | The removeFormFields property in API allows you to exclude specific form fields from a document before sending it. You provide a string array with the IDs of the existing form fields you want to remove. One or more values can be specified. |
| `enableAuditTrailLocalization` | `boolean` | No | Enable localization for audit trail based on the signer's language. If null is provided, the value will be inherited from the Business Profile settings. Only one additional language can be specified in the signer's languages besides English. |
| `syncDir` | `dir` | No | SyncDir |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "boldsign",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "boldsign-send-document-template",
  arguments: {
    templateId: "Template ID",
    title: "Title",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "boldsign-send-document-template",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    boldsign: { authProvisionId: "apn_xxxxxxx" },
    templateId: "Template ID",
    title: "Title",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "boldsign-send-document-template",
    "configured_props": {
      "boldsign": { "authProvisionId": "apn_xxxxxxx" },
      "templateId": "Template ID",
      "title": "Title"
    }
  }'
```

---

- App: https://pipedream.com/apps/boldsign.md · All apps: https://pipedream.com/apps
