# Create or Update Contact — AttractWell

> Creates or updates a contact with the provided identification and contact details.

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

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `email` | `string` | No | The email address of the contact. |
| `mobilePhone` | `string` | No | The mobile phone number of the contact. |
| `firstName` | `string` | No | The first name of the contact. |
| `lastName` | `string` | No | The last name of the contact. |
| `contactType` | `string` | No | The type of the contact. |
| `rating` | `string` | Yes | The rating of the contact. From 0 (coldest) to 5 (hottest). You'll get periodic reminders of which contacts to reach out to more often if you choose a higher rating, or not at all if you pick 0. |
| `workPhone` | `string` | No | The work phone number of the contact. |
| `homePhone` | `string` | No | The home phone number of the contact. |
| `address1` | `string` | No | The street address of the contact. |
| `city` | `string` | No | The city of the contact. |
| `state` | `string` | No | The state of the contact. |
| `postalCode` | `string` | No | The postal code of the contact. |
| `country` | `string` | No | The country of the contact. |
| `companyName` | `string` | No | The company name of the contact. |
| `title` | `string` | No | The title of the contact. |
| `campaignContactEmail` | `boolean` | Yes | The campaign contact email setting. |
| `campaignContactText` | `boolean` | Yes | The campaign contact text setting. |
| `receiveMarketingEmail` | `boolean` | Yes | The receive marketing email setting. |
| `receiveMarketingText` | `boolean` | Yes | The receive marketing text setting. |
| `tagsToAdd` | `string[]` | No | Tags to add to the contact. Options are loaded from the connected account. |
| `tagsToRemove` | `string[]` | No | Tags to remove from the contact. Options are loaded from the connected account. |
| `campaignsToAdd` | `string[]` | No | If a contact isn't already receiving a campaign, start sending these campaigns to them. Options are loaded from the connected account. |
| `campaignsToAddOrRestart` | `string[]` | No | If a contact is already receiving a campaign, restart these campaigns. If a contact is not receiving a campaign, start sending these campaigns to them. Options are loaded from the connected account. |
| `campaignsToRemove` | `string[]` | No | Campaigns to remove from the contact. Options are loaded from the connected account. |
| `offlineCampaignsToAdd` | `string[]` | No | Offline campaigns to add to the contact. Options are loaded from the connected account. |
| `offlineCampaignsToRemove` | `string[]` | No | Offline campaigns to remove from the contact. Options are loaded from the connected account. |
| `addToVaults` | `string[]` | No | Give Access To Vault (Contact Still Must Pay For Paid Vaults). Options are loaded from the connected account. |
| `addToVaultsForFree` | `string[]` | No | Give Access To Vault For Free (Contact Gets Free Access To Paid Vaults). Options are loaded from the connected account. |
| `removeFromVaults` | `string[]` | No | Vaults to remove the contact from. Options are loaded from the connected account. |
| `automationsToRun` | `string[]` | No | Automations to run for the contact. Options are loaded from the connected account. |
| `mayAccessMemberArea` | `boolean` | Yes | Whether the user may access or is banned from the member area. If this is set to true, they only are able to access the member area if they are also assigned to one or more vaults. |

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

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: "attractwell-create-update-contact",
  arguments: {
    email: "Email",
    mobilePhone: "Mobile Phone",
  },
})
```

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

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": "attractwell-create-update-contact",
    "configured_props": {
      "attractwell": { "authProvisionId": "apn_xxxxxxx" },
      "email": "Email",
      "mobilePhone": "Mobile Phone"
    }
  }'
```

---

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