← Back to Pull requests

CXH-1251: document BambooHR roles/access-levels API limitation #35

Closed
unknown closed this pull request without merging on Oct 30, 2026 17:02 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 22:46 UTC
Author

CXH-1251: BambooHR roles as entitlements — investigated; API cannot express them, documented instead of forcing a partial sync

Linear: CXH-1251 — BambooHR: Sync roles as an entitlement capability

What was asked

A customer asked for BambooHR roles to be synced as an entitlement capability, in addition to the accounts the connector already syncs. The ticket's own action was to investigate first whether BambooHR's API exposes roles in a way C1 can consume as entitlements, and update the ticket with the finding either way. This PR is that finding: the investigation is complete, the answer is no (details below), and per the agreed acceptance criteria the PR documents exactly what the API cannot express instead of forcing a partial sync.

What changed

A docs-only diff — three files, prose and a comment only, no Go behavior change (verified: git diff main... shows exactly these files; baton_capabilities.json, config_schema.json, specs/openapi.json and the config regeneration are untouched and regenerate identically):

1. docs/connector.mdx — one paragraph of prose below the existing Capabilities table (the table itself is byte-identical) stating that BambooHR's public API exposes no roles/access-levels surface for C1 to sync, with vendor-doc citations and the pending-live-confirmation caveat pointing at the README section below.
2. README.md — a ### Not synced: roles / access levels subsection under # Data Model, the canonical in-repo copy: the three negative findings with citations, the 2026-10-23 checked date, and the two re-verification triggers a future engineer should watch (the per-tenant Datasets catalog GET /api/v1_2/datasets; any future endpoint adopting the access_level OAuth scope).
3. pkg/connector/connector.go — a four-line factual doc comment above ResourceSyncers, the exact site the next contributor would edit to add a roles builder, pointing at the README section.

The finding (why roles cannot be synced)

  • No public endpoint lists roles or access levels. The complete official API reference (documentation.bamboohr.com, all groups from Account Information through Recognition Settings, checked 2026-10-23) contains no Roles/Access Levels/User Permissions group and no endpoint returning a user→role/access-level membership edge. The only user-account endpoint, GET /api/v1/meta/users, returns id, employeeId, name, email, status (enabled/disabled) and lastLogin — no access-level or role attribute.

  • No reportable per-employee access-level field. The connector's current sync mechanism is the custom-report API (POST /api/gateway.php/{domain}/v1/reports/custom, documented as deprecated in favor of Datasets). Its requestable field catalog (the documented field-names list) contains no accessLevel/role/permission field of any kind — so no per-employee access level can even be requested to turn into entitlements.

  • The OAuth access_level scope exists but no documented endpoint uses it. The OpenAPI securitySchemes declare access_level ("View and manage User Access Levels"), but no documented endpoint requires or consumes the scope. A scope without an endpoint is not an API surface a connector can call.

  • Datasets are per-tenant and undocumented per tenant. GET /api/v1_2/datasets returns "the catalog of datasets available ... the current account has access to" — account-specific, not part of the documented cross-customer contract; even a live hit on C1's own test tenant would not generalize.
  • How far this is verified

  • Feasibility investigation: complete against the official BambooHR API documentation (API reference index fetched in full; field-names table searched; technical overview + Datasets/OpenAPI definitions read), 2026-10-23.

  • Live-API confirmation: NOT APPLICABLE, reason verbatim: the reviewed credential profile resolved the API key from the vault item "BambooHR", but that item carries no Company Domain field, so the connector's tenant could not be resolved (credentials.json: incomplete_configuration); the only tenant hint in the vault (c1feb26, from the sibling LOGIN item's URL) returns 404 for every documented API path shape on both hosts, and a deliberately-invalid key returns the identical 404 — the gateway rejects the tenant path before auth, so live validation could not complete. Remediation for a human: add a Company Domain field carrying the API key's actual tenant subdomain to the vault item; the discovery/mapping machinery itself worked. This caveat is stated in the repo docs as "pending", not papered over.

  • Build/run: SMOKE PASS (partial) — cmd/baton-bamboohr builds and starts; this repo declares no mock, so no sync was exercised — the change is unproven against a live or mocked upstream by the smoke gate. Connector-eval (advisory) adds the execution evidence: the head was recorded against a mock of the vendor API built from its official docs — verdict clean, 0 resources/entitlements/grants lost or gained vs main (c90364b), 0 id changes — i.e. the docs/comment diff provably does not alter sync output.

  • Review: judged winner of 5 competing implementations of the same plan (adversarial review to SHIP on every finished attempt; independent evaluator scores 9.5–10/10, connector rulebook 100/100 with 0 violations). This PR's head passed a two-round adversarial review.

  • CI and the repo's review bot: green and passed at this head — 8 checks terminal and none failing (verify/lint, verify/test, verify/docs, verify-versions-match, block-versions-yaml-edits, connector-docs/validate, pr-review; verify/regression skips per repo convention), and the bot's re-review after the one fix pass (c86d167) ruled "No blocking issues found". The bot's round-1 review suggested the README carry the live-confirmation caveat that the mdx cross-reference promised; commit c86d167 added that line and the thread was resolved.

  • Independent verification inside the batch: a fresh-clone tester (VERA) re-ran the build, the tests and the doc-surface checks on this head: 6 of 7 claims WORKS with captured evidence; the one UNTESTABLE claim is the live-tenant confirmation (the credential boundary above). An independent deep reviewer with no prior exposure to the batch read the PR cold in a separate environment and raised 0 findings.
  • What to look at hardest

  • The docs/connector.mdx addition is the only CI-verified docs surface in the diff: the repo's connector-docs workflow runs an MDX linter (syntax + allowed component set, fetched from ConductorOne/github-workflows on 2026-10-23) — the addition is plain prose below the byte-identical Capabilities table, but that workflow is this diff's real gate.

  • The connector.go comment and README wording are the contract the next "sync roles" ticket starts from: check that the three negatives, the checked date, and the two re-verification triggers (Datasets catalog; access_level scope adoption) read as complete and accurate.

  • The pending-live-confirmation caveat: if the credential gap is closed, a live check should be run and this PR's docs updated — the wording deliberately does not claim live confirmation.
  • Full evidence blocks (quoted verbatim from the batch's research)

    F1 — No public endpoint lists roles or access levels

    The complete official API reference index enumerates these API groups: Account Information, Alerts, Applicant Tracking, Benefits, Change Tracking, Company Files, Company Profile, Compensation, Compensation Benchmarking, Compensation Planning, Custom Fields, Custom Reports, Datasets, Employee Files, Employee Tables, EmployeeVerification, Employees, Goals, Holidays, Hours, Locations, Login, Time Tracking, Onboarding, Pay Grades & Bands, Photos, Reports, Scheduling, Time Off, Total Rewards, Training, Webhooks, Calendar Events, Public API, Custom Tables, Recognition Settings. There is no "Roles", "Access Levels" or "User Permissions" group, and no endpoint anywhere in the index returns a user→role/access-level membership edge.

    The only user-account endpoint is GET /api/v1/meta/users (List Users) — user id, employeeId, first/last name, email, account status (enabled/disabled) and lastLogin. No access-level or role attribute. Support admin accounts are always excluded.

    F2 — The employee field catalog has no access-level/role field

    The custom-report API (the connector's current sync mechanism, POST /api/gateway.php/{domain}/v1/reports/custom — documented as "Request Custom Report", marked Deprecated, use Datasets > Get Data from Dataset) can only return fields from the documented field-names catalog: no accessLevel, no role, no user-permission field of any kind exists. All six "access" hits in the table are prose about "accessing" other tables.

    F3 — An OAuth scope for access levels exists, but no endpoint uses it

    The OpenAPI securitySchemes declare the OAuth scope access_level: "View and manage User Access Levels" (plus access_level.write). No documented endpoint requires or uses that scope. The scope names a capability of the BambooHR product (admin UI), not a public API surface. A scope without an endpoint is not consumable by a connector.

    F4 — Datasets are account-specific and undocumented per tenant

    GET /api/v1_2/datasets (List Datasets v1.2) returns "the catalog of datasets available ... the current account has access to". Whether any account exposes a users/access dataset is per-tenant, discoverable only by a live authenticated call, and is not part of the documented API contract a connector can rely on across customers.

    F5 — Live confirmation is currently blocked at the credential boundary

    The reviewed credential profile bamboohr resolved the API key from the vault item "BambooHR" (API_CREDENTIAL) via its credential field, but that item carries no Company Domain field, so BATON_COMPANY_DOMAIN resolves nothing (credentials.json: incomplete_configuration). Using documented precedence (env > file > vault), the non-secret domain was supplied from the sibling LOGIN item's URL (c1feb26.bamboohr.com): discovery then succeeded but the independent preflight failed (preflight_http_error). Live probes (status codes only; secret values never printed or persisted) showed every documented API path shape on both hosts — https://api.bamboohr.com/api/gateway.php/{d}/v1/..., https://{d}.bamboohr.com/api/gateway.php/{d}/v1/..., https://{d}.bamboohr.com/api/v1/... — returns 404 for tenant c1feb26, and a deliberately-invalid key returns the identical 404, i.e. the gateway rejects the tenant path before auth. The one tenant hint in the vault is therefore not an API tenant.

    What a human can do to complete the live half: add a Company Domain field (carrying the API key's actual tenant subdomain) to the "BambooHR" vault item, or supply the correct tenant out-of-band. The 1P discovery/mapping machinery itself worked.

    Pagination notes

    For the surface that exists: meta/users is unpaginated (single object keyed by user id); the legacy reports/custom call the connector uses is unpaginated (newUnPaginatedURL in pkg/connector/client/request.go); the Datasets API (v2) is cursor-paginated but exposes only per-account reporting datasets (F4). There is no paginated roles collection because there is no roles collection.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: c1-squire-dev[bot] Review duration: 9735m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #35"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%