# Create Hour Record — BambooHR

> Add a single approved hour record to the legacy Hours API, separate from Time Tracking timesheets — use Create Hour Entry instead for timesheet-integrated hours. You choose the record's ID; save it to update or delete this record later…

- Key: `bamboohr-create-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/create-hour-record
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/bamboohr/actions/create-hour-record/create-hour-record.mjs

## Description

Add a single approved hour record to the legacy Hours API, separate from Time Tracking timesheets — use **Create Hour Entry** instead for timesheet-integrated hours. You choose the record's ID; save it to update or delete this record later with **Update Hour Record** / **Delete Hour Record**. [See the documentation](https://documentation.bamboohr.com/reference/create-time-tracking-hour-record)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `recordId` | `string` | Yes | A unique ID you choose for this record (up to 36 characters), e.g. 550e8400-e29b-41d4-a716-446655440000 (a UUID). Save it — you'll need it to update or delete this record later. |
| `employeeId` | `string` | Yes | The employee ID (e.g. 100). Run Get Employees Directory to discover IDs. |
| `dateHoursWorked` | `string` | Yes | The date the hours were worked, in YYYY-MM-DD format, e.g. 2026-09-01. |
| `hoursWorked` | `string` | Yes | Number of hours worked as a decimal, e.g. 8 or 7.5. |
| `rateType` | `string` | Yes | The type of hours worked. |
| `divisionId` | `string` | No | Optional numeric division ID, e.g. 1. Company-specific; find valid IDs in your BambooHR payroll/company settings. |
| `departmentId` | `string` | No | Optional numeric department ID, e.g. 2. Company-specific; find valid IDs in your BambooHR payroll/company settings. |
| `jobTitleId` | `string` | No | Optional numeric job title ID, e.g. 3. Company-specific; find valid IDs in your BambooHR payroll/company settings. |
| `payCode` | `string` | No | Optional pay code; required by some payroll providers, e.g. REG1. Company-specific; check with your payroll provider or BambooHR admin. |
| `payRate` | `string` | No | Optional hourly pay rate as a decimal, e.g. 15.00. |
| `jobCode` | `string` | No | Optional numeric job code, e.g. 100. Company-specific; find valid codes in your BambooHR payroll/company settings. |
| `jobData` | `string` | No | Up to four 20-character job numbers, comma-delimited, e.g. JOB1,JOB2. |

## 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-create-hour-record",
  arguments: {
    recordId: "Record ID",
    employeeId: "Employee ID",
  },
})
```

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

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-create-hour-record",
    "configured_props": {
      "bamboohr": { "authProvisionId": "apn_xxxxxxx" },
      "recordId": "Record ID",
      "employeeId": "Employee ID"
    }
  }'
```

---

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