# Update User Info — Lucca

> Update profile or HR information for an existing user. See the documentation

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

## Description

Update profile or HR information for an existing user. [See the documentation](https://developers.lucca.fr/api-reference/legacy/directory/update-a-user-by-id)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `userId` | `string` | Yes | The ID of the user Options are loaded from the connected account. |
| `firstName` | `string` | No | The user's first name |
| `lastName` | `string` | No | The user's last name |
| `mail` | `string` | No | The user's email |
| `login` | `string` | No | The user's login |
| `legalEntityId` | `integer` | No | The ID of the legal entity Options are loaded from the connected account. |
| `calendarId` | `integer` | No | The ID of the calendar |
| `employeeNumber` | `string` | No | The employee number |
| `birthDate` | `string` | No | The birth date of the user. Format: 'YYYY-MM-DD'. |
| `address` | `string` | No | The address of the user |
| `bankName` | `string` | No | The name of the bank |
| `directLine` | `string` | No | The direct line of the user |
| `gender` | `string` | No | The gender of the user |
| `nationality` | `string` | No | The nationality of the user Options are loaded from the connected account. |
| `personalEmail` | `string` | No | The personal email of the user |
| `personalMobile` | `string` | No | The personal mobile of the user |
| `professionalMobile` | `string` | No | The professional mobile of the user |
| `quote` | `string` | No | The quote of the user |

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

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

---

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