# Create Contact — robly

> Create a new contact in Robly. See the documentation

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

## Description

Create a new contact in Robly. [See the documentation](https://docs.robly.com/docs/api-v1/441cf0bf51a98-generate-a-signup)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `email` | `string` | Yes | Email address of the contact |
| `autogenerateFields` | `boolean` | No | When true, field tags will be autogenerated based on the parameters sent into the request |
| `doubleOptIn` | `boolean` | No | When true, the welcome email will be sent to the member |
| `fieldTags` | `object` | No | The field tags are sent in as parameters based on the name of the field. These fields are configured when your account is setup, and should correspond to fields that already exist in the account configuration. For example, if you have a custom field for color, you would send in the parameter {"color": "purple"} to set the field to purple for the user. Note that all parameter names for fields should be in lower case. Invalid fields will be ignored, and could throw an HTTP 500 server error. |
| `includeAutomations` | `boolean` | No | When true, automations are updated with the new member |
| `includeAutoresponder` | `boolean` | No | When true, sends the autoresponder email on the sub_lists that the new member has been subscribed to |
| `subLists` | `integer[]` | No | Array of sub-list IDs to add the contact to Options are loaded from the connected account. |
| `welcomeEmail` | `boolean` | No | When true, the welcome email for the sign up process is sent |

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

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: "robly-create-contact",
  arguments: {
    email: "Email",
    autogenerateFields: true,
  },
})
```

**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: "robly-create-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    robly: { authProvisionId: "apn_xxxxxxx" },
    email: "Email",
    autogenerateFields: true,
  },
})

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": "robly-create-contact",
    "configured_props": {
      "robly": { "authProvisionId": "apn_xxxxxxx" },
      "email": "Email",
      "autogenerateFields": true
    }
  }'
```

---

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