# Send Document — Papersign

> Dispatches a document to a specified recipient. See the documentation

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

## Description

Dispatches a document to a specified recipient. [See the documentation](https://paperform.readme.io/reference/papersignsenddocument)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `documentId` | `string` | Yes | Enter the ID of the Papersign document Options are loaded from the connected account. |
| `expiration` | `string` | No | The expiration date of the document. Must be at least 30 minutes in the future. Format: YYYY-MM-DDTHH:MM:SS.SSSZ |
| `inviteMessage` | `string` | No | The message to include in the invitation email, up to 1000 characters. |
| `fromUserEmail` | `string` | No | The email address of a User on your team's account to send the document from. |
| `documentRecipientEmails` | `string[]` | No | An array of recipient emails for the document. |
| `firstAfterDays` | `integer` | No | The number of days after the document is sent to send the reminder. |
| `followUpEveryDays` | `integer` | No | The number of days to wait between reminders. |
| `signers` | `string[]` | No | An array of objects of signers. Object format: {"key": "123","name": "Jack Smith","email": "signer@example.com","phone": "123 456 7899","job_title": "Account Manager","company": "Explosive Startup","custom_attributes": [{"key": "Relationship","label": "Relationship to the company","value": "CEO"}]} |
| `variables` | `object` | No | The key: value of the document variables. |
| `copy` | `boolean` | No | Whether to copy before sending. |

## 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": "papersign",
      },
    },
  },
)

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: "papersign-send-document",
  arguments: {
    documentId: "Document ID",
    expiration: "Expiration",
  },
})
```

**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: "papersign-send-document",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    papersign: { authProvisionId: "apn_xxxxxxx" },
    documentId: "Document ID",
    expiration: "Expiration",
  },
})

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": "papersign-send-document",
    "configured_props": {
      "papersign": { "authProvisionId": "apn_xxxxxxx" },
      "documentId": "Document ID",
      "expiration": "Expiration"
    }
  }'
```

---

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