SDKs & Postman
The OpenAPI document is the source of truth; everything on this page is generated from it. Use the Postman collection to explore, the thin clients to get going, or generate a full SDK in your stack.
Postman#
Download the collection Download the environment
Import both into Postman, set apiKey in the environment, and every one of the 45 requests is ready with example bodies. The collection uses {{baseUrl}} (defaults to https://api.lojiq.ai/v1) and bearer auth at the collection level.
Thin clients (TypeScript and Python)#
Two single-file clients with one method per endpoint, no dependencies beyond fetch / urllib. They are generated from the spec by a small script and are intentionally thin: they add the auth header, build the URL, serialise JSON, and raise on errors. Types are loose (Record<string, unknown> / dict); use the reference for field names.
lojiq.ts — ES2020, works in Node 18+ and Deno/Bun.
import { Lojiq } from './lojiq';
const lojiq = new Lojiq({ apiKey: process.env.LOJIQ_KEY! });
const lead = await lojiq.createLead({
phone_number: '+15551234567', first_name: 'Avery', consent_source: 'web_form', consented_at: new Date().toISOString(),
});
const { data: calls } = await lojiq.listCalls({ lead_id: lead.id, limit: 10 });
const sub = await lojiq.createWebhook({ target_url: 'https://example.com/lojiq', event_types: ['call.transcript_ready'] });
console.log(sub.secret); // store it
lojiq.py — Python 3.9+, standard library only.
from lojiq import Lojiq
lojiq = Lojiq(api_key=os.environ["LOJIQ_KEY"])
lead = lojiq.create_lead({"phone_number": "+15551234567", "first_name": "Avery", "consent_source": "web_form"})
calls = lojiq.list_calls(lead_id=lead["id"], limit=10)["data"]
sub = lojiq.create_webhook({"target_url": "https://example.com/lojiq", "event_types": ["call.transcript_ready"]})
print(sub["secret"]) # store it
Errors raise LojiqError with .status, .code (the error field) and .requestId / .request_id.
Generate a full SDK#
For typed models in any language, run OpenAPI Generator against the spec:
# TypeScript (fetch)
npx @openapitools/openapi-generator-cli generate -i https://docs.lojiq.ai/openapi.yaml -g typescript-fetch -o ./lojiq-ts \
--additional-properties=npmName=@yourorg/lojiq,supportsES6=true
# Python
npx @openapitools/openapi-generator-cli generate -i https://docs.lojiq.ai/openapi.yaml -g python -o ./lojiq-py \
--additional-properties=packageName=lojiq
# anything else: csharp, go, java, php, ruby, kotlin, swift5 …
npx @openapitools/openapi-generator-cli list
The CLI needs Java 11+. Validate first with npx @openapitools/openapi-generator-cli validate -i https://docs.lojiq.ai/openapi.yaml.
Browser voice SDK#
Joining browser calls is a separate, tiny ES module served by the API itself: import { join } from 'https://api.lojiq.ai/v1/sdk/voice.js'. Your backend creates the call with POST /agents/{id}/calls (medium: {"web": {}}) and hands the join_url to the page; the SDK connects it and reports status (connecting | joined | listening | thinking | speaking | ended) and transcripts. Always load it from that URL — it hides the transport, which will change.
<script type="module">
import { join } from 'https://api.lojiq.ai/v1/sdk/voice.js';
const call = await fetch('/api/start-call', { method: 'POST' }).then(r => r.json()); // your backend → POST /agents/{id}/calls
const session = await join(call.join_url, {
onStatus: (s) => console.log('call is', s),
onTranscript: (t) => console.log(t.speaker, t.text, t.final),
});
// session.mute(); session.unmute(); await session.leave();
</script>