Skip to main content

hebrah

Official Python SDK for the hebrah control plane API (hebrah-api).

Install

pip install hebrah

Requires Python 3.10+.

Quick start

import os
from hebrah import HebrahClient, verify_webhook_signature

with HebrahClient(
    api_key=os.environ["HEBRAH_API_KEY"],
    default_connection_id=os.environ.get("HEBRAH_CONNECTION_ID"),
) as client:
    catalog = client.sandbox.catalog()
    patient_id = catalog["sample_patient_ids"][0]
    patient = client.sandbox.resource("Patient", patient_id)

    client.webhooks.trigger_mock_event(
        event="patient.admitted",
        patient_id=patient_id,
    )

v0.8: default_connection_id is applied when sandbox methods omit connection_id. client.patients.list() / get() emit DeprecationWarning — use sandbox.list_synthetic_resources("Patient") instead.

Webhook verification

from hebrah import verify_webhook_signature

payload = verify_webhook_signature(
    request.get_data(),
    request.headers.get("X-Hebrah-Signature"),
    webhook_secret,
)

Security

  • Store HEBRAH_API_KEY and HEBRAH_WEBHOOK_SECRET in server-side environment variables or a secrets manager only — never expose them to browsers or commit .env files.
  • The SDK does not persist credentials; they live in memory for the lifetime of each HebrahClient instance.
  • base_url must be https:// in production, or http://localhost / http://127.0.0.1 for local dev — other http:// hosts are rejected at construction to reduce API-key exfiltration risk.
  • Treat HebrahApiError.detail as operator-only diagnostics. Do not log or return it to end users — it may contain internal paths or sensitive API error payloads. Set include_error_detail=False on HebrahClient to omit detail from errors.

See SECURITY.md for supported versions and vulnerability reporting.

API surface (v0.8)

Sandbox & resources

Method Description
client.health() GET /health (no API key on separate httpx call)
client.sandbox.catalog(connection_id=None) GET /v1/sandbox/catalog — uses default_connection_id when omitted
client.sandbox.domains() GET /v1/sandbox/domains
client.sandbox.domain(domain_id) GET /v1/sandbox/domains/{id}
client.sandbox.list_synthetic_resources(resource_type, connection_id=None) GET /v1/sandbox/resources/{type}
client.sandbox.resource(resource_type, resource_id, patient_id=None) GET /v1/sandbox/resources/{type}/{id}
client.sandbox.run_scenario(scenario_id, ...) POST /v1/sandbox/scenarios/{id}/run
client.sandbox.synthetic_ehr_profile(connection_id=...) GET /v1/sandbox/synthetic-ehr/profile
client.sandbox.list_ehr_models() GET /v1/sandbox/ehr-models
client.sandbox.reset_synthetic_ehr(connection_id=...) POST /v1/sandbox/synthetic-ehr/reset
client.sandbox.payer_rules(payer_id) GET /v1/sandbox/payer-rules/{id}
client.patients.list(connection_id=None) DeprecatedGET /v1/patients
client.patients.get(id, connection_id=None) DeprecatedGET /v1/patients/{id}

HL7, webhooks, interop

Method Description
client.sandbox.hl7_templates() GET /v1/sandbox/hl7/templates
client.sandbox.inject_hl7(...) POST /v1/sandbox/hl7/inject
client.sandbox.configure_webhook_reliability(**profile) PATCH /v1/sandbox/webhook-reliability
client.sandbox.run_webhook_reliability_scenario(scenario_id, ...) POST /v1/sandbox/scenarios/{id}/run (alias)
client.sandbox.run_mpi_match(...) POST /v1/sandbox/mpi/match
client.sandbox.run_aggregator_query(...) POST /v1/sandbox/aggregator/query
client.sandbox.get_practitioner_credentialing(practitioner_id) GET /v1/sandbox/credentialing/practitioners/{id}
client.webhooks.trigger_mock_event(...) POST /v1/webhooks/trigger-mock-event
client.webhooks.list_deliveries(...) GET /v1/webhooks/deliveries
client.webhooks.replay_delivery(delivery_id) POST /v1/webhooks/deliveries/{id}/replay
verify_webhook_signature(raw_body, signature, secret) Local HMAC-SHA256 verify

SMART & FHIR

Method Description
client.smart.launch(...) POST /v1/smart/launch
client.smart.register_client(...) POST /v1/smart/clients
client.smart.exchange_token(...) POST /oauth/token (form-encoded; no API key)
client.fhir.read_patient(patient_id, access_token) GET /fhir/R4/Patient/{id} (SMART access token)

Advanced: BYOM agent harness

HebrahAgentHarness is exported for bring-your-own-model EHR workflows (MCP + integration-agent). It is not part of the core integrator quick start — harness improvements are tracked separately from the core client.

Configuration

Variable Description
HEBRAH_API_KEY Pass to HebrahClient(api_key=...)
HEBRAH_API_BASE_URL Optional; default https://api.hebrah.com
HEBRAH_CONNECTION_ID Optional; pass to default_connection_id for sandbox reads
HEBRAH_WEBHOOK_SECRET For verify_webhook_signature

Docs

Full integrator reference: hebrah-app /docs/sdk.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hebrah-0.8.1.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hebrah-0.8.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file hebrah-0.8.1.tar.gz.

File metadata

  • Download URL: hebrah-0.8.1.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hebrah-0.8.1.tar.gz
Algorithm Hash digest
SHA256 545997e9884c1fe9ed2b17342c0445cfae3addb2643bc1522ebbf635243bcc47
MD5 3aa9c89f4ba1aba8af089fff2b6a5923
BLAKE2b-256 acf5ad268421a5f745036a40f786daa11af20bdfed261eda18852071528c3a99

See more details on using hashes here.

Provenance

The following attestation bundles were made for hebrah-0.8.1.tar.gz:

Publisher: ci.yml on Hebrah-inc/hebrah-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hebrah-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: hebrah-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hebrah-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a95a9cc1f2a25e0f8de46fa8c337f5499e7e2134d387d2bd7288c46286541dad
MD5 9e2e99b6c60ae24f6a901cd7ec6c674d
BLAKE2b-256 bf722a15c5325863261039a73897a25eb2faf254a577f681676e0b60c45fb5b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for hebrah-0.8.1-py3-none-any.whl:

Publisher: ci.yml on Hebrah-inc/hebrah-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page