# Create Distributable Form and Generate Link — pdfFiller

> Transforms a document into a fillable form and generates a shareable link for the form. See the documentation

- Key: `pdffiller-create-distributable-form-generate-link`
- Type: Action (Write)
- Version: 0.0.4
- App: pdfFiller (`pdffiller`) — https://pipedream.com/apps/pdffiller.md
- This page (HTML): https://pipedream.com/apps/pdffiller/actions/create-distributable-form-generate-link
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/pdffiller/actions/create-distributable-form-generate-link/create-distributable-form-generate-link.mjs

## Description

Transforms a document into a fillable form and generates a shareable link for the form. [See the documentation](https://docs.pdffiller.com/docs/pdffiller/9d3a06696db96-create-fillable-document-converts-a-downloaded-document-to-a-link-to-fill-form)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `documentId` | `string` | Yes | The ID of the document template. Options are loaded from the connected account. |
| `access` | `string` | Yes | Access level for the fill request document. |
| `status` | `string` | Yes | Document access permission. |
| `nameRequired` | `boolean` | Yes | Name required |
| `emailRequired` | `boolean` | Yes | Email required |
| `enforceRequiredFields` | `boolean` | Yes | Prevent closing document before filling all fields. |
| `allowDownloads` | `boolean` | Yes | Allow to download |
| `redirectUrl` | `string` | No | Redirect to URL after complete. |
| `customMessage` | `string` | No | LinkToFill custom message. |
| `notificationEmails` | `string[]` | No | LinkToFill notification emails. |
| `additionalDocuments` | `string[]` | No | Additional documents required after filling the document. Max count 5. |

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

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: "pdffiller-create-distributable-form-generate-link",
  arguments: {
    documentId: "Document ID",
    access: "Access",
  },
})
```

**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: "pdffiller-create-distributable-form-generate-link",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    pdffiller: { authProvisionId: "apn_xxxxxxx" },
    documentId: "Document ID",
    access: "Access",
  },
})

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": "pdffiller-create-distributable-form-generate-link",
    "configured_props": {
      "pdffiller": { "authProvisionId": "apn_xxxxxxx" },
      "documentId": "Document ID",
      "access": "Access"
    }
  }'
```

---

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