# Fill Existing Form — Emboss

> Fill a form you previously created in Emboss, using context text and/or a context file; Emboss populates the detected fields from your context and returns the completed PDF. Create the form first with Create Fillable Form. Provide at least…

- Key: `emboss-fill-existing-form`
- Type: Action (Write)
- Version: 0.0.2
- App: Emboss (`emboss`) — https://pipedream.com/apps/emboss.md
- This page (HTML): https://pipedream.com/apps/emboss/actions/fill-existing-form
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/emboss/actions/fill-existing-form/fill-existing-form.mjs

## Description

Fill a form you previously created in Emboss, using context text and/or a context file; Emboss populates the detected fields from your context and returns the completed PDF. Create the form first with **Create Fillable Form**. Provide at least one context input. Polls up to ~12 minutes. [See the documentation](https://getemboss.ai/docs/reference/fill-with-context)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `formId` | `string` | Yes | The ID of a previously created, ready Emboss form. Use the List Forms action to look up available forms, or copy the form_id returned by Create Fillable Form, e.g. 6c47f7f5-f921-4698-910f-95dd7d81310b. |
| `contextText` | `string` | No | Information to fill the form with, e.g. Applicant: Jane Doe, 38 Birchwood Court, Mooresville, IN — phone (317) 555-0126. |
| `contextFile` | `string` | No | A URL or /tmp path to a context document (PDF, DOCX, CSV, image, or text), e.g. /tmp/customer-data.pdf or https://example.com/invoice.pdf. |
| `idempotencyKey` | `string` | No | A unique string (e.g. a UUID) to safely retry this request. If a previous request with the same key already started a job, Emboss returns that original job instead of starting a new one. Scoped to your account; valid 24 hours. |
| `callbackUrl` | `string` | No | A public HTTPS URL Emboss will POST the job result to when it finishes (ready or failed), signed with X-Emboss-Signature, e.g. https://example.com/webhooks/emboss. Optional — this action already polls until the job completes. |
| `syncDir` | `dir` | No | The File Stash directory the output PDF is written to. Defaults to /tmp. |

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

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: "emboss-fill-existing-form",
  arguments: {
    formId: "Form ID",
    contextText: "Context (Text)",
  },
})
```

**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: "emboss-fill-existing-form",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    emboss: { authProvisionId: "apn_xxxxxxx" },
    formId: "Form ID",
    contextText: "Context (Text)",
  },
})

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": "emboss-fill-existing-form",
    "configured_props": {
      "emboss": { "authProvisionId": "apn_xxxxxxx" },
      "formId": "Form ID",
      "contextText": "Context (Text)"
    }
  }'
```

---

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