# Update Hour Record — BambooHR

> Edit an existing legacy Hours API record's hours worked and links. Send the corrected total hours worked, not a delta. Use Get Time Tracking Record to check current values first. See the documentation

- Key: `bamboohr-update-hour-record`
- Type: Action (Write)
- Version: 0.0.1
- App: BambooHR (`bamboohr`) — https://pipedream.com/apps/bamboohr.md
- This page (HTML): https://pipedream.com/apps/bamboohr/actions/update-hour-record
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/bamboohr/actions/update-hour-record/update-hour-record.mjs

## Description

Edit an existing legacy Hours API record's hours worked and links. Send the corrected total hours worked, not a delta. Use **Get Time Tracking Record** to check current values first. [See the documentation](https://documentation.bamboohr.com/reference/update-time-tracking-record)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `recordId` | `string` | Yes | The ID of the hour record to update, e.g. 550e8400-e29b-41d4-a716-446655440000 (the UUID you supplied in Create Hour Record). Run Get Time Tracking Record to check its current values, or use the ID you supplied in Create Hour Record. |
| `hoursWorked` | `string` | Yes | The corrected total number of hours worked (not a delta) — e.g. send 6.0 if the employee actually worked 6 hours instead of the original 8. |
| `projectId` | `string` | No | Optional numeric project ID, e.g. 19. Find valid IDs in your BambooHR time tracking project settings. |
| `taskId` | `string` | No | Optional numeric task ID within the project, e.g. 47 (requires projectId). Find valid IDs in your BambooHR time tracking project settings. |
| `shiftDifferentialId` | `string` | No | Optional numeric shift differential ID to associate with the record, e.g. 1. Company-specific; find valid IDs in your BambooHR payroll/company settings. |
| `holidayId` | `string` | No | Optional numeric holiday ID to associate with the record, e.g. 1. Company-specific (legacy Hours API); find valid IDs in your BambooHR payroll/company settings. |

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

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: "bamboohr-update-hour-record",
  arguments: {
    recordId: "Record ID",
    hoursWorked: "Hours Worked",
  },
})
```

**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: "bamboohr-update-hour-record",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    bamboohr: { authProvisionId: "apn_xxxxxxx" },
    recordId: "Record ID",
    hoursWorked: "Hours Worked",
  },
})

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": "bamboohr-update-hour-record",
    "configured_props": {
      "bamboohr": { "authProvisionId": "apn_xxxxxxx" },
      "recordId": "Record ID",
      "hoursWorked": "Hours Worked"
    }
  }'
```

---

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