# Create Document — GetAccept

> Create a document to be able to send it to a recipient. See the documentation

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

## Description

Create a document to be able to send it to a recipient. [See the documentation](https://app.getaccept.com/api/#createdocument)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | Yes | The name of the document. |
| `type` | `string` | No | Document type is used to set default values and look of a document. |
| `value` | `string` | No | Monetary value of document in entity currency. |
| `fileIds` | `string[]` | No | File Ids to previusly uploaded files, see section "Upload document(s)" here. |
| `fileName` | `string` | No | Sending a file, you must to type the filename of the document, with the extension. This will be helpful for converting different file-types. |
| `fileURL` | `string` | No | Url to document file. Documents must be public available for download. |
| `recipients` | `string[]` | No | A list of valid JSON of recipients you're sending the document to. Every object must contain first_name, last_name (or fullname) and email fields. The 'role' field is optional. If not set, a person will be assigned the role signer. See the object here. |
| `isSigning` | `boolean` | No | Should the document be enabled for e-signing. |
| `isSigningOrder` | `boolean` | No | Use specific order for signers. |
| `isSigningBiometric` | `boolean` | No | Drawn signature when signing. |
| `isSigningInitials` | `boolean` | No | Initials are set as default sign method. |
| `isSelfsign` | `boolean` | No | Should the sender also sign the document. |
| `expirationDate` | `string` | No | Default value from entity settings but can be overrided by setting a date. Accepted formats: yyyy-MM-dd, dd-MM-yyyy, MM/dd/yyyy, yyyy-MM-ddTHH:mm:ss.SSSZ, Unix timestamp in seconds |
| `isReminderSending` | `boolean` | No | Should the system automatically send reminders based on the entity sending settings? |
| `isSigningForward` | `boolean` | No | Should a recipient be able to forward the signing rights to someone else? |
| `isIdentifyRecipient` | `boolean` | No | Enable identification of new recipients by cookie. |
| `isSMSSending` | `boolean` | No | Should the sending automatically include an SMS message to recipients with valid mobile numbers? |
| `isAutomaticSending` | `boolean` | No | Used to send documents immediately. Requires a file-parameter to import and send. true: Send immediately and false: Status draft. |
| `isScheduledSending` | `boolean` | No | If the automatic sending should be scheduled. |
| `scheduledSendingTime` | `string` | No | Date and time when document will be sent if scheduled. |
| `videoId` | `string` | No | Specify a video to be presented before the document is opened. |
| `templateId` | `string` | No | Use this to specify a template to be used for the document. |
| `replacePages` | `boolean` | No | True to replace pages in template. |
| `keepFields` | `boolean` | No | True to keep form fields in template. |
| `senderEmail` | `string` | No | Use this to specify the sender user/owner by email to be used for the document. Options are loaded from the connected account. |
| `communicationTemplateId` | `string` | No | Use this to specify the communication template to be used for the document. |
| `emailSendSubject` | `string` | No | Use this to specify the subject line used to send out the document. |
| `emailSendMessage` | `string` | No | Use this to specify a message to the recipient(s) when sending out the document. |
| `customFields` | `object` | No | Enter custom data to be used identifying the field either by name or id. |
| `attachments` | `string[]` | No | A list of attachments to include with the document. Every attachment must contain a type and a title. If the type is file, it must have the Id field, if the type is external, it must have url field. See the object here. |
| `customPricingTables` | `string[]` | No | A list of pricing-table objects. See the object here. |

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

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: "getaccept-create-document",
  arguments: {
    name: "Name",
    type: "Type",
  },
})
```

**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: "getaccept-create-document",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    getaccept: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    type: "Type",
  },
})

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": "getaccept-create-document",
    "configured_props": {
      "getaccept": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "type": "Type"
    }
  }'
```

---

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