# Update Employee — TalentHR

> Allows updating an existing employee's data in the system. See the documentation

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

## Description

Allows updating an existing employee's data in the system. [See the documentation](https://apidocs.talenthr.io/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `employeeId` | `string` | Yes | The ID of the employee Options are loaded from the connected account. |
| `firstName` | `string` | Yes | The first name of the new employee |
| `lastName` | `string` | Yes | The last name of the new employee |
| `email` | `string` | Yes | The email address of the new employee |
| `reportsToEmployeeId` | `string` | No | If the Reports To Employee ID is 'null' then the current employee will be the head of the company. Options are loaded from the connected account. |
| `ssn` | `string` | No | The social security number of the employee |
| `birthDate` | `string` | No | The birth date must be formatted as 'YYYY-MM-DD' and must be between now and 1930-01-01. |
| `personalEmail` | `string` | No | The email has to be unique (among personal emails). |
| `maritalStatus` | `string` | No | The marital status of the employee |
| `gender` | `string` | No | The gender of the employee |
| `nationality` | `string` | No | The nationality of the employee Options are loaded from the connected account. |
| `citizenship` | `string` | No | The citizenship of the employee |
| `workPhone` | `string` | No | The phone number of the employee's work |
| `mobilePhone` | `string` | No | The mobile phone numbe of the employee |
| `phone` | `string` | No | The phone numbe of the employee |
| `address` | `string` | No | The address where the meeting will take place. Required if Who ID and When Time is present. |
| `country` | `string` | No | The country where the employee lives Options are loaded from the connected account. |
| `postalCode` | `string` | No | The postal code where the employee lives |
| `city` | `string` | No | The city where the employee lives |
| `emergencyContactFullName` | `string` | No | The emergency contact's full name |
| `emergencyContactRelationshipTypeId` | `string` | No | The type of the emergency contact's relationship Options are loaded from the connected account. |
| `emergencyContactPhone` | `string` | No | The emergency contact's phone number |
| `emergencyContactAddress` | `string` | No | The emergency contact's address |
| `linkedInUrl` | `string` | No | The URL of the linkedIn |
| `employeeNumber` | `string` | No | An external number of the employee |
| `passportNumber` | `string` | No | The number of the employee's passport |
| `passportIssuedDate` | `string` | No | The issued date of the employee's passport. Format YYYY-MM-DD |
| `passportExpiryDate` | `string` | No | The expiry date of the employee's passport. Format YYYY-MM-DD |
| `passportIssuingCountry` | `string` | No | The issuing country of the employee's passport |
| `visaType` | `string` | No | The type of the employee's visa |
| `visaNumber` | `string` | No | The number of the employee's visa |
| `visaExpiryDate` | `string` | No | The expiry date of the employee's visa. Format YYYY-MM-DD |
| `driverLicenseNumber` | `string` | No | The number of the employee's driver license |
| `driverLicenseIssuedDate` | `string` | No | The issued date of the employee's driver license. Format YYYY-MM-DD |
| `driverLicenseExpiryDate` | `string` | No | The expiry date of the employee's driver license. Format YYYY-MM-DD |
| `driverLicenseIssuingCountry` | `string` | No | The issuing country of the employee's driver license |
| `secAddress` | `string` | No | An employee's aditional address |
| `secCity` | `string` | No | An employee's aditional city |
| `secPostalCode` | `string` | No | An employee's aditional postal code |
| `secCountry` | `string` | No | An employee's aditional country |
| `twitterUrl` | `string` | No | The employee's Twitter URL |
| `facebookUrl` | `string` | No | The employee's Facebook URL |
| `instagramUrl` | `string` | No | The employee's Instagram URL |
| `pinterestUrl` | `string` | No | The employee's Pinterest URL |
| `githubUrl` | `string` | No | The employee's GitHub URL |
| `behanceUrl` | `string` | No | The employee's Behance URL |
| `skypeName` | `string` | No | The employee's Skype name |
| `shirtSize` | `string` | No | The size of the shirt the employee wears |
| `tShirtSize` | `string` | No | The size of the t-shirt the employee wears |
| `hrLanguages` | `integer[]` | No | A list of language ids |
| `hrFamily` | `string[]` | No | An array of family objects. Example: {"name": "Jhon Doe", "gender": "Male", "birth_date": "2001-10-10", "family_member_relationship_id": "1" } |
| `allergies` | `string` | No | The employee's allegies |

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

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: "talenthr-update-employee",
  arguments: {
    employeeId: "Employee ID",
    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: "talenthr-update-employee",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    talenthr: { authProvisionId: "apn_xxxxxxx" },
    employeeId: "Employee ID",
    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": "talenthr-update-employee",
    "configured_props": {
      "talenthr": { "authProvisionId": "apn_xxxxxxx" },
      "employeeId": "Employee ID",
      "firstName": "First Name"
    }
  }'
```

---

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