# Create Form Action — Form.io

> Attach an action (e.g. email, webhook, save) to a Form.io form. Use List Forms to find the form ID and List Form Actions to review existing actions. The settings prop is a JSON-string object specific to the action type. Example: actionType…

- Key: `form_io-create-form-action`
- Type: Action (Write)
- Version: 0.0.1
- App: Form.io (`form_io`) — https://pipedream.com/apps/form-io.md
- This page (HTML): https://pipedream.com/apps/form-io/actions/create-form-action
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/form_io/actions/create-form-action/create-form-action.mjs

## Description

Attach an action (e.g. email, webhook, save) to a Form.io form. Use **List Forms** to find the form ID and **List Form Actions** to review existing actions. The `settings` prop is a JSON-string object specific to the action type. Example: `actionType` `webhook`, `title` `Notify endpoint`, `handler` `[after]`, `method` `[create]`, `settings` `{"url":"https://example.com/hook","method":"post"}` → returns the new action with its `_id`. [See the documentation](https://apidocs.form.io/#b3435953-c007-48d9-9f4c-a8e2ee717419).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `formId` | `string` | Yes | The _id of the form. Run List Forms first to obtain valid form IDs. |
| `actionType` | `string` | Yes | The Form.io action type to attach — e.g. webhook, email, save, login, role. This selects which built-in action runs; it is NOT a display label (use title for that). |
| `title` | `string` | Yes | The human-readable title of the action. |
| `handler` | `string[]` | Yes | When the action runs. Values: before, after. |
| `method` | `string[]` | Yes | Which operations trigger the action. Values: create, update, read, delete, index. |
| `priority` | `integer` | No | Execution priority of the action. |
| `settings` | `string` | No | JSON-string object of action-specific settings. Example: {"transport":"default","from":"noreply@example.com","to":"admin@example.com","subject":"New submission"}. Parsed from a JSON string 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": "form_io",
      },
    },
  },
)

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: "form_io-create-form-action",
  arguments: {
    formId: "Form ID",
    actionType: "Action 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: "form_io-create-form-action",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    form_io: { authProvisionId: "apn_xxxxxxx" },
    formId: "Form ID",
    actionType: "Action 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": "form_io-create-form-action",
    "configured_props": {
      "form_io": { "authProvisionId": "apn_xxxxxxx" },
      "formId": "Form ID",
      "actionType": "Action Type"
    }
  }'
```

---

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