Skip to main content
A call to an ElevenLabs agent reaches your server through three webhooks, and the adapter answers each: the conversation initiation one hands over the context as a dynamic variable, the server tools run the history kit for whoever is on the line, and the post-call one records the transcript turn by turn and ends the conversation. The integration is on the server side, not the device: in a contact center, the call starts on a phone.

Install

The TypeScript integration ships with @niadra/sdk 0.3.0, ready on main and on npm when it is published; until then the npm package is 0.1.1.

The five primitives

The Niadra conversation id is the call’s call_sid (else ElevenLabs’ conversation_id), the same in all three webhooks. The subject is the caller’s number; pass subject= (a function of the call’s variables) for callers identified otherwise.

Minimal example

The handlers are plain functions of the body and the headers: they fit FastAPI, Flask, Django, Hono, a Lambda or a Worker. The same code is in examples/elevenlabs_server.py and examples/elevenlabs-hono.ts.

Agent memory

With agent_memory=True, the agent’s own notes arrive in the niadra_agent_memory variable; put {{niadra_agent_memory}} right before {{niadra_context}} in the agent’s prompt. See Agent memory.

Limits

  • The initiation webhook and the server tools return customer data, so they require the X-Niadra-Secret header you configure in ElevenLabs (shared_secret); without it, 401.
  • Niadra slow or down never fails the call: the initiation answers an empty context, a tool answers that the history is unavailable, and the post-call webhook still answers 200.
  • The carrier’s attestation does not come in ElevenLabs’ webhook; without it, the read is at V0.
  • Tested with recorded payloads in the public format of the three webhooks and signatures computed in the test itself; no ElevenLabs account is needed.

Next steps

Voice agents

what the call proves and what the policy releases.

Vapi

the same design, on one server URL.