Claude Code skill pack for BambooHR (18 skills)
Installation
Open Claude Code and run this command:
/plugin install bamboohr-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
Skills (18)
Configure CI/CD pipelines for BambooHR integrations with GitHub Actions, automated testing, and secret management.
BambooHR CI Integration
Overview
Set up CI/CD pipelines for BambooHR integrations with proper secret management, unit tests with mocked API, and optional integration tests against the real BambooHR API.
Prerequisites
- GitHub repository with Actions enabled
- BambooHR test API key (sandbox company or test account)
- npm/pnpm project with test suite configured
Instructions
Step 1: Configure GitHub Secrets
# Required for integration tests
gh secret set BAMBOOHR_API_KEY --body "your-test-api-key"
gh secret set BAMBOOHR_COMPANY_DOMAIN --body "your-test-company"
# Optional: webhook testing
gh secret set BAMBOOHR_WEBHOOK_SECRET --body "your-webhook-hmac-secret"
Step 2: GitHub Actions Workflow
# .github/workflows/bamboohr-integration.yml
name: BambooHR Integration
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Run daily to catch BambooHR API changes early
- cron: '0 6 * * 1-5'
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run typecheck
- name: Unit tests (mocked BambooHR API)
run: npm test -- --coverage --reporter=verbose
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage
path: coverage/
integration-tests:
runs-on: ubuntu-latest
# Only run on main branch and schedule (not PRs from forks)
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
needs: unit-tests
env:
BAMBOOHR_API_KEY: ${{ secrets.BAMBOOHR_API_KEY }}
BAMBOOHR_COMPANY_DOMAIN: ${{ secrets.BAMBOOHR_COMPANY_DOMAIN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Integration tests (real BambooHR API)
run: npm run test:integration
timeout-minutes: 5
- name: API health check
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-u "${BAMBOOHR_API_KEY}:x" \
-H "Accept: application/json" \
"https://api.bamboohr.com/api/gateway.php/${BAMBOOHR_COMPANY_DOMAIN}/v1/employees/directory")
echo "BambooHR API status: $STATUS"
[ "$STATUS" -eq 200 ] || exit 1
Step 3: Test Structure
// tests/unit/bamboohr-client.test.ts
import { describe, it, expect, beforeAll, afterAll, afterEach } from 'vitest';
import { setupServer } from 'Diagnose and fix BambooHR API errors and exceptions.
BambooHR Common Errors
Overview
Diagnostic reference for BambooHR REST API errors. BambooHR returns error details in the X-BambooHR-Error-Message response header for most 400-level and some 500-level errors.
Prerequisites
- BambooHR API access configured
- Access to application logs or HTTP response headers
Instructions
Step 1: Read the Error Header
Always check X-BambooHR-Error-Message first — it contains BambooHR's specific error detail, which is more useful than generic HTTP status text.
const res = await fetch(`${BASE}/employees/999/`, {
headers: { Authorization: AUTH, Accept: 'application/json' },
});
if (!res.ok) {
const errorDetail = res.headers.get('X-BambooHR-Error-Message');
console.error(`HTTP ${res.status}: ${errorDetail || res.statusText}`);
}
Step 2: Match Error to Solution
401 Unauthorized — Invalid API Key
X-BambooHR-Error-Message: Invalid API key
Cause: API key is missing, expired, revoked, or malformed in the Basic Auth header.
Solution:
# Verify key is set
echo "Key length: ${#BAMBOOHR_API_KEY}"
# Test auth directly
curl -s -o /dev/null -w "%{http_code}" \
-u "${BAMBOOHR_API_KEY}:x" \
"https://api.bamboohr.com/api/gateway.php/${BAMBOOHR_COMPANY_DOMAIN}/v1/employees/directory"
Common mistakes:
- Using Bearer token instead of Basic Auth
- Putting the API key as the password instead of the username
- Missing the
:xpassword part in Basic Auth encoding
403 Forbidden — Insufficient Permissions
X-BambooHR-Error-Message: You do not have access to this resource
Cause: The API key's user account lacks permissions for the requested endpoint or employee.
Solution:
- Verify the user's access level in BambooHR (Account > Access Levels)
- Time-off management endpoints require manager or admin permissions
- Compensation table access requires admin permissions
- Some fields are restricted to specific access levels
400 Bad Request — Invalid Fields or Payload
X-BambooHR-Error-Message: Invalid field: "jobTitl"
Cause: Misspelled field name, invalid date format, or malformed JSON body.
Solution:
# Verify field names against BambooHR's field list
curl -s -u "${BAMBOOHR_API_KEY}:x" \
"https://api.bamboohr.com/api/gateway.php/${BAMBOOHR_COMPANY_DOMAIN}/v1/employees/0/?fields=firstName,lastName" \
-H "Accept: application/json"
Execute BambooHR primary workflows: employee CRUD, directory sync, and custom reports.
BambooHR Core Workflow A — Employee Management & Reports
Overview
Primary BambooHR workflows: CRUD operations on employees, directory sync to external systems, custom reports, and table data (job history, compensation, emergency contacts).
Prerequisites
- Completed
bamboohr-install-authsetup BambooHRClientfrombamboohr-sdk-patterns- API key with appropriate permissions (read or read+write)
Instructions
Step 1: Add a New Employee
// POST /employees/ — minimum: firstName + lastName
const newEmpRes = await fetch(`${BASE}/employees/`, {
method: 'POST',
headers: { Authorization: AUTH, 'Content-Type': 'application/json' },
body: JSON.stringify({
firstName: 'Sarah',
lastName: 'Chen',
department: 'Engineering',
jobTitle: 'Backend Engineer',
workEmail: 'sarah.chen@acmecorp.com',
hireDate: '2026-04-01',
location: 'San Francisco',
status: 'Active',
}),
});
// New employee ID is in the Location header
const locationHeader = newEmpRes.headers.get('Location');
// e.g., "https://api.bamboohr.com/.../v1/employees/456"
const newId = locationHeader?.split('/').pop();
console.log(`Created employee ID: ${newId}`);
Step 2: Update Employee Fields
// POST /employees/{id}/ — only send fields you want to change
await fetch(`${BASE}/employees/${newId}/`, {
method: 'POST',
headers: { Authorization: AUTH, 'Content-Type': 'application/json' },
body: JSON.stringify({
jobTitle: 'Senior Backend Engineer',
department: 'Platform Engineering',
}),
});
Fields that trigger position history changes: jobTitle, department, division, location, reportsTo. Updating these creates a new row in the employee's position history table.
Step 3: Directory Sync to External System
interface SyncResult {
created: number;
updated: number;
deactivated: number;
errors: string[];
}
async function syncBambooHRDirectory(
onSync: (emp: BambooEmployee, action: string) => Promise<void>,
): Promise<SyncResult> {
const result: SyncResult = { created: 0, updated: 0, deactivated: 0, errors: [] };
// Fetch full directory
const { employees } = await client.getDirectory();
// Use the "changed since" endpoint for incremental sync
// GET /employees/changed/?since=2026-03-20T00:00:00Z
const changedRes = await client.request<Record<string, { lastChanged: string }>>(
'GET', `/employees/changed/?since=${lastSyncTimestamp}`,
);
for (const [empId, meta] of Object.entries(changeExecute BambooHR secondary workflows: time off requests, PTO balances, benefits administration, and employee files/photos.
BambooHR Core Workflow B — Time Off, Benefits & Files
Overview
Secondary BambooHR workflows covering time off requests, PTO balance tracking, employee file management, photos, goals, and training records.
Prerequisites
- Completed
bamboohr-install-authsetup BambooHRClientfrombamboohr-sdk-patterns- API key with time-off and files permissions
Instructions
Step 1: List Time Off Requests
// GET /time_off/requests/?start=YYYY-MM-DD&end=YYYY-MM-DD
const requests = await client.request<any[]>(
'GET',
`/time_off/requests/?start=2026-03-01&end=2026-03-31&status=approved`,
);
for (const req of requests) {
console.log(`${req.employeeId}: ${req.start} to ${req.end} (${req.type.name})`);
console.log(` Status: ${req.status.status} | ${req.amount.amount} ${req.amount.unit}`);
}
Time off request response shape:
[
{
"id": "100",
"employeeId": "123",
"status": { "status": "approved", "lastChanged": "2026-03-15" },
"name": "Jane Smith",
"start": "2026-03-20",
"end": "2026-03-22",
"type": { "id": "1", "name": "Vacation" },
"amount": { "unit": "days", "amount": "3" },
"notes": { "employee": "Spring break trip", "manager": "" },
"dates": {
"2026-03-20": "1", "2026-03-21": "1", "2026-03-22": "1"
}
}
]
Step 2: Create a Time Off Request
// PUT /employees/{id}/time_off/request
await fetch(`${BASE}/employees/123/time_off/request`, {
method: 'PUT',
headers: { Authorization: AUTH, 'Content-Type': 'application/json' },
body: JSON.stringify({
status: 'requested',
start: '2026-04-15',
end: '2026-04-18',
timeOffTypeId: 1, // 1 = Vacation, varies by company
amount: 4,
notes: { employee: 'Family vacation' },
dates: {
'2026-04-15': '1',
'2026-04-16': '1',
'2026-04-17': '1',
'2026-04-18': '1',
},
previousRequest: 0,
}),
});
Step 3: Approve or Deny a Request
// PUT /time_off/requests/{requestId}/status
await fetch(`${BASE}/time_off/requests/100/status`, {
method: 'PUT',
headers: { Authorization: AUTH, 'Content-Type': 'application/json' },
body: JSON.stringify({
status: 'Optimize BambooHR integration costs through request reduction, caching, and usage monitoring.
BambooHR Cost Tuning
Overview
BambooHR pricing is per-employee-per-month (not per-API-call), but excessive API usage triggers rate limiting (503 errors) which causes sync failures and operational issues. This skill covers reducing API call volume, monitoring usage, and building efficient sync patterns.
Prerequisites
- BambooHR integration in production
- Understanding of current API usage patterns
- Application logging capturing API calls
Instructions
Step 1: Understand BambooHR Pricing
BambooHR charges by employee count, not API calls:
| Plan | Pricing Model | API Access |
|---|---|---|
| Essentials | Per employee/month | Full REST API |
| Advantage | Per employee/month | Full REST API + advanced reports |
| Custom/Enterprise | Negotiated | Full API + dedicated support |
Key insight: API call volume does not directly affect your bill, but hitting rate limits causes operational failures. Optimize for reliability, not cost.
Step 2: Audit Current API Usage
// Instrument your client to log all API calls
class InstrumentedBambooHRClient {
private callLog: { endpoint: string; method: string; timestamp: number; durationMs: number }[] = [];
async request<T>(method: string, path: string, body?: unknown): Promise<T> {
const start = Date.now();
const result = await this.innerClient.request<T>(method, path, body);
this.callLog.push({
endpoint: path.split('?')[0], // Strip query params
method,
timestamp: start,
durationMs: Date.now() - start,
});
return result;
}
generateReport(): void {
// Group by endpoint
const byEndpoint = new Map<string, number>();
for (const call of this.callLog) {
const key = `${call.method} ${call.endpoint}`;
byEndpoint.set(key, (byEndpoint.get(key) || 0) + 1);
}
console.log('\n=== BambooHR API Usage Report ===');
console.log(`Total calls: ${this.callLog.length}`);
console.log(`Time window: ${((Date.now() - this.callLog[0]?.timestamp || 0) / 1000 / 60).toFixed(1)} minutes`);
console.log('\nBy endpoint:');
for (const [endpoint, count] of [...byEndpoint.entries()].sort((a, b) => b[1] - a[1])) {
const pct = ((count / this.callLog.length) * 100).toFixed(1);
console.log(` ${count.toString().padStart(5)} (${pct}%) ${endpoint}`);
}
}
}
Step 3: Eliminate Wasteful Patterns
Pattern 1: Replace polling with webhooks
// BAD: Polling every 5 minutes (288 calls/day minimum)
setInterval(async () => {
const dir = await client.getDirectory();
checkForChanges(dir);
}, 5 * Collect BambooHR debug evidence for support tickets and troubleshooting.
BambooHR Debug Bundle
Overview
Collect all diagnostic information for BambooHR API troubleshooting or support tickets. Captures connectivity tests, API response details, environment info, and redacted configuration.
Prerequisites
- BambooHR environment variables set
curlavailable for API tests- Permission to collect environment info
Instructions
Step 1: Complete Debug Bundle Script
#!/bin/bash
# bamboohr-debug-bundle.sh — Run this, then send the .tar.gz to support
set -euo pipefail
BUNDLE_DIR="bamboohr-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
DOMAIN="${BAMBOOHR_COMPANY_DOMAIN:?Set BAMBOOHR_COMPANY_DOMAIN}"
API_KEY="${BAMBOOHR_API_KEY:?Set BAMBOOHR_API_KEY}"
BASE="https://api.bamboohr.com/api/gateway.php/${DOMAIN}/v1"
exec > >(tee "$BUNDLE_DIR/summary.txt") 2>&1
echo "=== BambooHR Debug Bundle ==="
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "Company Domain: ${DOMAIN}"
echo "API Key: ${API_KEY:0:4}****${API_KEY: -4}"
echo ""
# ── Environment ──────────────────────────────────────
echo "--- Runtime Environment ---"
echo "Node.js: $(node --version 2>/dev/null || echo 'not installed')"
echo "npm: $(npm --version 2>/dev/null || echo 'not installed')"
echo "Python: $(python3 --version 2>/dev/null || echo 'not installed')"
echo "curl: $(curl --version 2>/dev/null | head -1)"
echo "OS: $(uname -a)"
echo ""
# ── API Connectivity Test ────────────────────────────
echo "--- API Connectivity ---"
echo -n "Directory endpoint: "
curl -s -o "$BUNDLE_DIR/directory-response.json" \
-w "HTTP %{http_code} | %{time_total}s | %{size_download} bytes\n" \
-u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/employees/directory"
echo -n "Employee endpoint: "
curl -s -o "$BUNDLE_DIR/employee-response.json" \
-w "HTTP %{http_code} | %{time_total}s | %{size_download} bytes\n" \
-u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/employees/0/?fields=firstName"
echo -n "Time off types: "
curl -s -o "$BUNDLE_DIR/timeoff-types-response.json" \
-w "HTTP %{http_code} | %{time_total}s\n" \
-u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/meta/time_off/types"
echo ""
# ── Response Headers (verbose for one endpoint) ─────
echo "--- Response Headers (directory) ---"
curl -s -I -u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/employees/directory" \
| grep -iE "^(x-bamboohr|content-type|retDeploy BambooHR integrations to Vercel, Fly.
BambooHR Deploy Integration
Overview
Deploy BambooHR-powered applications to cloud platforms with proper secrets management, health checks, and webhook endpoint configuration. Covers Vercel (serverless), Fly.io (containers), and Google Cloud Run.
Prerequisites
- BambooHR integration tested locally and in staging
- Production API key and company domain ready
- Platform CLI installed (
vercel,fly, orgcloud)
Instructions
Vercel Deployment (Serverless)
# Set BambooHR secrets in Vercel
vercel env add BAMBOOHR_API_KEY production
vercel env add BAMBOOHR_COMPANY_DOMAIN production
vercel env add BAMBOOHR_WEBHOOK_SECRET production
vercel.json:
{
"functions": {
"api/**/*.ts": {
"maxDuration": 30
}
},
"crons": [{
"path": "/api/bamboohr/sync",
"schedule": "0 */6 * * *"
}]
}
Webhook endpoint (Vercel serverless):
// api/webhooks/bamboohr.ts
import { verifyBambooHRWebhook } from '../../src/bamboohr/security';
export const config = { api: { bodyParser: false } };
export default async function handler(req: any, res: any) {
if (req.method !== 'POST') return res.status(405).end();
const chunks: Buffer[] = [];
for await (const chunk of req) chunks.push(chunk);
const rawBody = Buffer.concat(chunks);
const sig = req.headers['x-bamboohr-signature'];
const ts = req.headers['x-bamboohr-timestamp'];
if (!verifyBambooHRWebhook(rawBody, sig, ts, process.env.BAMBOOHR_WEBHOOK_SECRET!)) {
return res.status(401).json({ error: 'Invalid signature' });
}
const event = JSON.parse(rawBody.toString());
// Process webhook asynchronously
await processWebhookEvent(event);
return res.status(200).json({ received: true });
}
Deploy:
vercel --prod
# Webhook URL: https://your-app.vercel.app/api/webhooks/bamboohr
Fly.io Deployment (Containers)
fly.toml:
app = "my-bamboohr-sync"
primary_region = "iad"
[env]
NODE_ENV = "production"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = "suspend"
auto_start_machines = true
min_machines_running = 1
[[services.http_checks]]
interval = "30s"
timeout = "5s"
path = "/api/health"
method = "GET"
# Set secrets
fly secrets set BAMBOOHR_API_KEY="your-prod-key"
fly secrets set BAMBOOHR_COMPANY_DOMAIN="yourcompany"
fly secrets set BAMBOOHR_WEBHOOK_SECRET="your-Create a minimal working BambooHR example — fetch employee directory and single employee.
BambooHR Hello World
Overview
Minimal working examples for the three most common BambooHR API operations: fetch the employee directory, get a single employee by ID, and run a custom report.
Prerequisites
- Completed
bamboohr-install-authsetup BAMBOOHRAPIKEYandBAMBOOHRCOMPANYDOMAINenv vars set
Instructions
Step 1: Fetch Employee Directory
import 'dotenv/config';
const COMPANY = process.env.BAMBOOHR_COMPANY_DOMAIN!;
const API_KEY = process.env.BAMBOOHR_API_KEY!;
const BASE = `https://api.bamboohr.com/api/gateway.php/${COMPANY}/v1`;
const AUTH = `Basic ${Buffer.from(`${API_KEY}:x`).toString('base64')}`;
// GET /employees/directory — returns all active employees
const dirRes = await fetch(`${BASE}/employees/directory`, {
headers: { Authorization: AUTH, Accept: 'application/json' },
});
const directory = await dirRes.json();
console.log(`Company has ${directory.employees.length} employees`);
for (const emp of directory.employees.slice(0, 5)) {
console.log(` ${emp.displayName} — ${emp.jobTitle} (${emp.department})`);
}
Directory response shape:
{
"fields": [
{ "id": "displayName", "type": "text", "name": "Display Name" },
{ "id": "jobTitle", "type": "text", "name": "Job Title" }
],
"employees": [
{
"id": "123",
"displayName": "Jane Smith",
"firstName": "Jane",
"lastName": "Smith",
"jobTitle": "Software Engineer",
"department": "Engineering",
"location": "Remote",
"workEmail": "jane@acme.com",
"photoUrl": "https://..."
}
]
}
Step 2: Get a Single Employee
// GET /employees/{id}/?fields=firstName,lastName,jobTitle,department,hireDate,workEmail
const empRes = await fetch(
`${BASE}/employees/123/?fields=firstName,lastName,jobTitle,department,hireDate,workEmail,status`,
{ headers: { Authorization: AUTH, Accept: 'application/json' } },
);
const employee = await empRes.json();
console.log(`${employee.firstName} ${employee.lastName}`);
console.log(` Title: ${employee.jobTitle}`);
console.log(` Dept: ${employee.department}`);
console.log(` Hired: ${employee.hireDate}`);
console.log(` Email: ${employee.workEmail}`);
Common employee fields you can request:
| Field | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
firstName, lastName, d
|