# Update Contact — Salesmate

> This API is used to update a contact's details. See docs here

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

## Description

This API is used to update a contact's details. [See docs here](https://apidocs.salesmate.io/#72ca69e0-e70d-4fc5-837b-a758963300b3)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `contactId` | `integer` | Yes | The unique identifier of the contact. Options are loaded from the connected account. |
| `firstName` | `string` | No | First name of the contact. |
| `lastName` | `string` | Yes | Last name of the contact. |
| `owner` | `integer` | Yes | Owner of the contact. Options are loaded from the connected account. |
| `mobile` | `string` | No | Mobile number of the contact. |
| `company` | `integer` | No | The user can add a company for the contact from existing companies. If the contact's company is not defined, then the user can quickly add the company. Options are loaded from the connected account. |
| `email` | `string` | No | Email of the contact. |
| `website` | `string` | No | Website of the contact. |
| `googlePlusHandle` | `string` | No | Contact's Google Plus profile link. |
| `linkedInHandle` | `string` | No | Contact's LinkedIn profile link. |
| `phone` | `string` | No | Phone number 1 of the contact. |
| `otherPhone` | `string` | No | Phone number 2 of the contact. |
| `skypeId` | `string` | No | Contact's Skype ID. |
| `facebookHandle` | `string` | No | Contact's Facebook link. |
| `twitterHandle` | `string` | No | Contact's Twitter link. |
| `currency` | `string` | No | The three-letter ISO currency code, in uppercase. Options are loaded from the connected account. |
| `designation` | `string` | No | Contact's designation. |
| `billingAddressLine1` | `string` | No | Line one of the billing address of the contact. |
| `billingAddressLine2` | `string` | No | Line two of the billing address of the contact. |
| `billingCity` | `string` | No | City name of contact's address for billing purposes. |
| `billingZipCode` | `string` | No | Zip code of the billing City. |
| `billingState` | `string` | No | State name of contact's address for billing purposes. |
| `billingCountry` | `string` | No | Country name of contact's address for billing purposes. |
| `description` | `string` | No | Description about the contact. It contains an arbitrary string attached to the contact object. |
| `tags` | `string[]` | No | The tags associated with the contact. Options are loaded from the connected account. |

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

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: "salesmate-update-contact",
  arguments: {
    contactId: 10,
    firstName: "First Name",
  },
})
```

**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: "salesmate-update-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    salesmate: { authProvisionId: "apn_xxxxxxx" },
    contactId: 10,
    firstName: "First Name",
  },
})

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": "salesmate-update-contact",
    "configured_props": {
      "salesmate": { "authProvisionId": "apn_xxxxxxx" },
      "contactId": 10,
      "firstName": "First Name"
    }
  }'
```

---

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