make-call.ts β tsimport { Firetell } from '@firetell/firetell-node-sdk';βconst firetell = new Firetell({domain: 'yourcompany.firetell.app',secretKey: process.env.FIRETELL_SECRET_KEY!,});βconst call = await firetell.calls.make({from: { number: '+14155550100', name: 'Customer Support' },to: { number: '+12125550123', name: 'John Doe' },actions: [{ action: 'connect_agent', params: { agent_id: 'agt_abc123', timeout: 30 } },],});
| Method | Header | Use case |
|---|---|---|
| API Key | Authorization: ApiKey sk-... | Server-to-server calls from your backend (Workspace API) |
| JWT Token | Authorization: Bearer <jwt> | Client-side calls from web or mobile apps (Agent API & SDKs) |
| Event | Triggered when |
|---|---|
| call.created | A new inbound or outbound call is created |
| call.answered | The call is answered |
| call.ended | The call hangs up or fails, with duration and hangup cause |
| call.recording.ready | The recording file is processed and ready to download |
| call.transcription.completed | The full transcript and extracted entities are compiled |
| message.received | An inbound SMS/MMS arrives on one of your numbers |
| agent.state | An agent changes presence or availability |
| workspace.credit.updated | Your workspace credit balance changes |
webhook.ts β tsimport express from 'express';import { constructWebhookEvent } from '@firetell/firetell-node-sdk';βconst app = express();βapp.post('/webhooks/firetell', express.raw({ type: 'application/json' }), (req, res) => {const signature = req.header('x-webhook-signature') ?? '';βtry {const event = constructWebhookEvent(req.body,signature,process.env.FIRETELL_WEBHOOK_SECRET!,);// handle event.event: 'call.ended', 'call.recording.ready', ...console.log('Verified event:', event.event, event.data);res.sendStatus(200);} catch {res.status(400).send('Invalid signature');}});