Quickstart

Branches exposes a Candid-shaped API for sending healthcare encounters into the Branches revenue-cycle workflow. Create an encounter to hand Branches the patient, provider, diagnosis, service-line, and insurance context needed to prepare and submit a claim.

Base URL

https://api.withbranches.com

All public API paths are under /api.

Authenticate

Pass your workspace API key in the Authorization header:

curl https://api.withbranches.com/api/workspace \
  -H "Authorization: Bearer $BRANCHES_API_KEY"

A successful response returns the workspace attached to the key:

{
  "id": "workspace_123",
  "slug": "acme-health",
  "name": "Acme Health"
}

Use this endpoint as a credentials smoke test before sending encounter data.

Create an encounter

POST /api/encounters accepts a Candid-shaped encounter payload. The request must include a stable external_id; Branches uses it for idempotency.

curl https://api.withbranches.com/api/encounters \
  -H "Authorization: Bearer $BRANCHES_API_KEY" \
  -H "Content-Type: application/json" \
  -d @encounter.json

A new encounter returns 202 Accepted:

{
  "encounter_id": "enc_123",
  "encounterId": "enc_123"
}

If the same external_id has already been accepted, Branches returns the existing encounter with duplicate: true.

Read encounters and status events

After creating encounters, use the Candid-version read endpoints to reconcile status back into your system:

  • GET /api/encounters/candid-version
  • GET /api/encounters/candid-version/{encounter_id}
  • GET /api/encounters/candid-version/events
  • GET /api/encounters/candid-version/events/{event_id}

The events endpoint emits Candid-compatible event types such as CandidApi.Encounter.Created and CandidApi.Encounter.StatusUpdated.

Next steps

  • Authentication: API keys, workspace scoping, and auth failures
  • Encounters: required fields, idempotency, and Candid compatibility
  • Events: status polling and event payloads
  • Errors: Stripe-shaped error responses
  • API Reference: complete generated OpenAPI reference