# Update User — Teamwork

> Update a user in Teamwork. See the documentation

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

## Description

Update a user in Teamwork. [See the documentation](https://apidocs.teamwork.com/docs/teamwork/v1/people/put-people-id-json)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `peopleId` | `string` | Yes | The ID of the user to update Options are loaded from the connected account. |
| `emailAddress` | `string` | No | The email address of the person |
| `firstName` | `string` | No | The first name of the person |
| `lastName` | `string` | No | The last name of the person |
| `companyId` | `string` | No | ID of the company to list tasks from Options are loaded from the connected account. |
| `sendInvite` | `boolean` | No | Whether to send an invitation email to the new user |
| `title` | `string` | No | The job title of the person |
| `phoneNumberOffice` | `string` | No | The office phone number of the person |
| `phoneNumberOfficeExt` | `string` | No | The office phone extension of the person |
| `phoneNumberMobileCountrycode` | `string` | No | The country code for the mobile phone number |
| `phoneNumberMobilePrefix` | `string` | No | The prefix for the mobile phone number |
| `phoneNumberMobile` | `string` | No | The mobile phone number of the person |
| `phoneNumberHome` | `string` | No | The home phone number of the person |
| `phoneNumberFax` | `string` | No | The fax number of the person |
| `emailAlt1` | `string` | No | First alternative email address |
| `emailAlt2` | `string` | No | Second alternative email address |
| `emailAlt3` | `string` | No | Third alternative email address |
| `address` | `object` | No | Object containing address information. See the documentation for more information. |
| `profile` | `string` | No | The profile information of the person |
| `userTwitterName` | `string` | No | The Twitter handle of the person |
| `userLinkedin` | `string` | No | The LinkedIn profile URL of the person |
| `userFacebook` | `string` | No | The Facebook profile URL of the person |
| `userWebsite` | `string` | No | The personal website of the person |
| `imService` | `string` | No | The instant messaging service used by the person |
| `imHandle` | `string` | No | The instant messaging username of the person |
| `language` | `string` | No | The language preference for the person |
| `dateFormatId` | `integer` | No | The date format ID for the person |
| `timeFormatId` | `integer` | No | The time format ID for the person |
| `timezoneId` | `integer` | No | The timezone ID for the person |
| `calendarStartsOnSunday` | `string` | No | Whether the calendar starts on Sunday |
| `lengthOfDay` | `integer` | No | The length of day in hours |
| `workingHours` | `object` | No | Object containing working hours information. . See the documentation for more information. |
| `changeForEveryone` | `boolean` | No | Whether changes apply to everyone |
| `administrator` | `boolean` | No | Whether the person is an administrator |
| `canAddProjects` | `boolean` | No | Whether the person can add projects |
| `canManagePeople` | `boolean` | No | Whether the person can manage people |
| `autoGiveProjectAccess` | `boolean` | No | Whether to automatically give the person access to new projects |
| `canAccessCalendar` | `boolean` | No | Whether the person can access the calendar |
| `canAccessTemplates` | `boolean` | No | Whether the person can access templates |
| `canAccessPortfolio` | `boolean` | No | Whether the person can access the portfolio |
| `canManageCustomFields` | `boolean` | No | Whether the person can manage custom fields |
| `canManagePortfolio` | `boolean` | No | Whether the person can manage the portfolio |
| `canManageProjectTemplates` | `boolean` | No | Whether the person can manage project templates |
| `canViewProjectTemplates` | `boolean` | No | Whether the person can view project templates |
| `notifyOnTaskComplete` | `boolean` | No | Whether to notify when tasks are completed |
| `notifyOnAddedAsFollower` | `boolean` | No | Whether to notify when added as a follower |
| `notifyOnStatusUpdate` | `boolean` | No | Whether to notify on status updates |
| `textFormat` | `string` | No | The text format preference |
| `useShorthandDurations` | `boolean` | No | Whether to use shorthand durations |
| `userReceiveNotifyWarnings` | `boolean` | No | Whether the user receives notification warnings |
| `userReceiveMyNotificationsOnly` | `boolean` | No | Whether the user receives only their own notifications |
| `receiveDailyReports` | `boolean` | No | Whether the person should receive daily reports |
| `receiveDailyReportsAtWeekend` | `boolean` | No | Whether to receive daily reports on weekends |
| `receiveDailyReportsIfEmpty` | `boolean` | No | Whether to receive daily reports even if empty |
| `soundAlertsEnabled` | `boolean` | No | Whether sound alerts are enabled |
| `dailyReportSort` | `string` | No | The sort order for daily reports |
| `receiveDailyReportsAtTime` | `string` | No | The time to receive daily reports |
| `dailyReportEventsType` | `string` | No | The type of events for daily reports |
| `dailyReportDaysFilter` | `integer` | No | The days filter for daily reports |
| `avatarPendingFileRef` | `string` | No | Reference to pending avatar file |
| `removeAvatar` | `boolean` | No | Whether to remove the avatar |
| `allowEmailNotifications` | `boolean` | No | Whether to allow email notifications |
| `userType` | `string` | No | The type of user (account, collaborator, contact) |
| `privateNotes` | `string` | No | Private notes about the person |
| `getUserDetails` | `boolean` | No | Whether to return user details in the response |

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

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: "teamwork-update-user",
  arguments: {
    peopleId: "User ID",
    emailAddress: "Email Address",
  },
})
```

**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: "teamwork-update-user",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    teamwork: { authProvisionId: "apn_xxxxxxx" },
    peopleId: "User ID",
    emailAddress: "Email Address",
  },
})

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": "teamwork-update-user",
    "configured_props": {
      "teamwork": { "authProvisionId": "apn_xxxxxxx" },
      "peopleId": "User ID",
      "emailAddress": "Email Address"
    }
  }'
```

---

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