# Send Document — PandaDoc

> Move a document to sent status and send an optional email. See the documentation

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

## Description

Move a document to sent status and send an optional email. [See the documentation](https://developers.pandadoc.com/reference/send-document)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `documentId` | `string` | Yes | Specify document's ID Options are loaded from the connected account. |
| `subject` | `string` | No | Value that will be used as the email subject. |
| `message` | `string` | No | A message which will be sent by email with a link to a document to sign. |
| `silent` | `boolean` | No | Disables sent, viewed, comment and completed email notifications for document recipients and the document sender. By default, notifications emails are sent for specific actions. If set as true, it won't affect "Approve document" email notification sent to the Approver. |
| `senderEmail` | `string` | No | Set a sender (email) for the document. Must be an email which is a member on your account. |
| `forwarding_allowed` | `boolean` | No | Your recipient will be able/not able to forward the document to another email address. |
| `forwarding_with_reassigning_allowed` | `boolean` | No | Your recipient will be able/not able to forward the right to fill out all fields (including signature) assigned to them to another email address. |

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

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: "pandadoc-send-document",
  arguments: {
    documentId: "Document Id",
    subject: "Subject",
  },
})
```

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

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": "pandadoc-send-document",
    "configured_props": {
      "pandadoc": { "authProvisionId": "apn_xxxxxxx" },
      "documentId": "Document Id",
      "subject": "Subject"
    }
  }'
```

---

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