Guides · 15 / 42

Bland

Set the pre-call and post-call webhook URLs in your Bland pathway, call POST /v1/recall_and_enrich before the call and POST /v1/calls/end after it, and keep your key as a server-side secret.

The Northsun Bland kit is a published integration kit: pre-call enrichment and post-call memory write-back for a Bland.ai pathway. It calls the same two frozen routes documented on Voice integration patterns — POST /v1/recall_and_enrich before the call, POST /v1/calls/end after — and nothing else. The kit is published on npm under its current scope, and the versions there are older than the behaviour described on this page, which is the kit's current source; the next release ships under the Northsun package name (in progress). Until then, the two HTTP calls documented on this page work without the kit, as shown on Voice integration patterns; the contact form can supply the current package name. This is a Northsun-built, Northsun-maintained kit against Bland's documented webhook contract — not a native Bland feature or a certified Bland integration.

Set your key

NORTHSUN_API_KEY=sk_live_...
NORTHSUN_BASE_URL=https://mcp.northsun.ai   # set it explicitly; see below
BLAND_WEBHOOK_SECRET=...                # shared secret from Bland, recommended

NORTHSUN_API_KEY is your Northsun API key — see Installation for how to get one. Set it as a platform secret (wrangler secret put NORTHSUN_API_KEY on Cloudflare Workers, or your platform's equivalent), never as a plaintext environment value in a repo or client bundle.

These are names you choose. Pass the key and the base URL https://mcp.northsun.ai to the client's options explicitly: the kit reads no environment itself, and the published client defaults to an earlier hostname that serves the same surface.

Wire the webhooks

The kit's Cloudflare Worker example exposes two routes:

/bland/pre-call   -> POST /v1/recall_and_enrich  (before the agent connects)
/bland/post-call  -> POST /v1/calls/end          (after the call ends)

In your Bland pathway configuration, set:

pre-call webhook  = https://your-worker.example.com/bland/pre-call
post-call webhook = https://your-worker.example.com/bland/post-call

Bland calls the pre-call URL before connecting the agent and the post-call URL after the call ends; the key never leaves your server.

Use the context in your pathway

The pre-call response returns variables, a ready-to-use system_prompt and the quoted memory block as data (memory_block), not raw JSON, so your pathway template stays readable. The host-safe variables are:

  • {{is_returning}}
  • {{history_known}}
  • {{caller_known}}
  • {{has_memory_facts}}
  • {{line_type}}
  • {{memory_status}}

Caller-derived text (name, company, summary, facts) is not exposed as variables: a stored value would be interpolated into your agent's prompt outside the quoted data block. It reaches the model only inside the quoted memory block (memory_block). system_prompt already ends with that quoted block, after every instruction. A prompt you build from the variables alone has no memory block, while its wording still points the agent at one, so the caller's name, history and facts are dropped: use the returned system_prompt, or append the memory block to your own prompt.

See What recall gives you back for what populates these and when a value is legitimately absent rather than wrong.

Verify it

Run a test call through the pathway. Your worker logs should show one pre-call recall, then one POST /v1/calls/end when Bland's post-call webhook fires. See Hangup, and what happens next for what the 204 confirms and how to verify the write. A live-account call against a deployed endpoint is still owed for this kit; treat your own test call as the proof.

Next steps