API Reference
SDK & Examples

SDK & Examples

Base URL: https://app.lisn.dev/api

Quick integration examples for common languages and frameworks.


Python

import requests
 
API_URL = "https://app.lisn.dev/api"
API_TOKEN = "YOUR_API_TOKEN"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
 
# 1. Create a voice assistant
assistant = requests.post(f"{API_URL}/v1/assistants", headers=headers, json={
    "name": "My Analyzer",
    "type": "voice",
    "stt_provider": "elevenlabs",
    "llm_provider": "openai",
    "system_prompt": "Analyze this call transcript...",
}).json()
 
# 2. Send audio for analysis
result = requests.post(
    f"{API_URL}/v1/requests/voice",
    headers=headers,
    data={"assistant_id": assistant["id"]},
    files={"audio_file": open("call.wav", "rb")},
).json()
 
print(result["summary_text"])
print(result["raw_response"])

JavaScript / Node.js

const API_URL = "https://app.lisn.dev/api";
const API_TOKEN = "YOUR_API_TOKEN";
const headers = { "Authorization": `Bearer ${API_TOKEN}` };
 
// 1. Create a text assistant
const assistant = await fetch(`${API_URL}/v1/assistants`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({
    name: "Chat Analyzer",
    type: "text",
    llm_provider: "openai",
    system_prompt: "Analyze this dialogue...",
  }),
}).then(r => r.json());
 
// 2. Send text conversation
const result = await fetch(`${API_URL}/v1/requests/text`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({
    assistant_id: assistant.id,
    conversation: [
      { role: "operator", text: "Hello!" },
      { role: "client", text: "I need help with billing" },
    ],
  }),
}).then(r => r.json());
 
console.log(result);

cURL

# List your assistants
curl -s "https://app.lisn.dev/api/v1/assistants" \
  -H "Authorization: Bearer YOUR_API_TOKEN" | jq
 
# Send audio
curl -X POST "https://app.lisn.dev/api/v1/requests/voice" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "assistant_id=ast_abc123" \
  -F "audio_file=@call.wav"
 
# Send text
curl -X POST "https://app.lisn.dev/api/v1/requests/text" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "assistant_id": "ast_xyz789",
    "conversation": [
      {"role": "operator", "text": "How can I help?"},
      {"role": "client", "text": "Pricing please"}
    ]
  }'