Skip to main content
Telnyx’s Call Control API is event-driven: Telnyx sends webhook events to your server for each call state change, and your server responds with Call Control commands. You use the transfer command to bridge the call audio to the Humain SIP gateway, or the stream_start command to pipe audio over a WebSocket. This guide uses the SIP transfer approach, which requires minimal server-side code and works with any Telnyx voice plan.
Store your credential as an environment variable. Never hard-code hk_live_… tokens in source files, dialplans, or configuration files committed to version control. Use an environment variable (HUMAIN_CREDENTIAL) or a secrets manager and inject the value at runtime.

How it works


Webhook handler


Telnyx portal configuration

  1. In the Telnyx Mission Control Portal, go to Call Control → Applications.
  2. Create a new application. Set Webhook URL to https://your-server.example.com/webhook.
  3. Set Webhook API Version to API v2.
  4. Under Numbers, assign your Telnyx number to the application.
Telnyx expects your webhook to return 200 OK within 2 seconds of receiving the event. The handler above responds 200 immediately before processing, which prevents timeouts even when the Humain API call takes 200–400 ms.

Verifying the integration

Use the Telnyx CLI to trigger a test call:
Watch your server logs for the event sequence: call.initiated → call.answered → call.bridged → call.hangup.