API Documentation
Access Kridtech's services remotely via API.
Introduction
Welcome to the Kridtech API documentation. Our API allows you to create and manage your AI voice agent programmatically.
Base URL
https://backend.kridtech.com
Rate Limits
All API endpoints are rate-limited to ensure fair usage. If you exceed the rate limit, you'll receive a 429 Too Many Requests response. To extend this limit, please contact us.
Authentication
Kridtech uses API keys to authenticate requests. Include your API credentials in the request headers. Your key can be found on your dashboard.
Required Headers
| Header | Type | Description |
|---|---|---|
| x-api-key | string | Your API key for authentication |
Example Request
curl https://backend.kridtech.com/api/calls \ -H "x-api-key: YOUR_API_KEY"
Create Phone Call
Creates an outbound phone call to a specified phone number using your AI agent.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| accountId | string | Required | Your account's login ID |
| toNumber | string | Required | The phone number to call (E.164 format recommended) |
| dynamicVariables | object | Optional | Custom variables to pass to the AI agent |
Example Request
curl -X POST https://backend.kridtech.com/api/create-call \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"accountId": "your-account-id",
"toNumber": "+1234567890",
"dynamicVariables": {
"company_name": "Acme Corp",
"appointment_time": "2:00 PM"
}
}'
const axios = require('axios');
const response = await axios.post(
'https://backend.kridtech.com/api/create-call',
{
accountId: 'your-account-id',
toNumber: '+1234567890',
dynamicVariables: {
company_name: 'Acme Corp',
appointment_time: '2:00 PM'
}
},
{
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
}
);
console.log(response.data);
import requests
url = 'https://backend.kridtech.com/api/create-call'
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
data = {
'accountId': 'your-account-id',
'toNumber': '+1234567890',
'dynamicVariables': {
'company_name': 'Acme Corp',
'appointment_time': '2:00 PM'
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Response
{
"success": true,
"callId": "call_abc123xyz",
"callStatus": "registered"
}
Response Codes
Create Web Call
Creates a web-based voice call that can be integrated into your web application for real-time voice conversations.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| accountId | string | Required | Your account ID |
| firstName | string | Optional | First name of the user initiating the call |
| dynamicVariables | object | Optional | Custom variables to pass to the AI agent |
Example Request
curl -X POST https://backend.kridtech.com/api/create-web-call \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"accountId": "your-account-id",
"dynamicVariables": {
"user_tier": "premium",
"support_level": "priority"
}
}'
const axios = require('axios');
const response = await axios.post(
'https://backend.kridtech.com/api/create-web-call',
{
accountId: 'your-account-id',
dynamicVariables: {
user_tier: 'premium',
support_level: 'priority'
}
},
{
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
}
);
console.log(response.data);
import requests
url = 'https://backend.kridtech.com/api/create-web-call'
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
data = {
'accountId': 'your-account-id',
'dynamicVariables': {
'user_tier': 'premium',
'support_level': 'priority'
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Response
{
"success": true,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"callId": "webcall_xyz789",
"accountId": "your-account-id",
"sampleRate": 24000
}
Using the Access Token
The accessToken returned should be used with the Web SDK to establish the voice connection in your web application. The token is valid for the duration of the call session.
Response Codes
Get Calls
Retrieves a list of calls associated with your account, with optional filtering by status.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| status | string | Optional | Filter calls by status — completed, ongoing, failed |
| limit | number | Optional | Maximum number of calls to return (default: 50, max: 100) |
Example Request
curl -X GET "https://backend.kridtech.com/api/calls?status=completed&limit=10" \ -H "x-api-key: YOUR_API_KEY"
const axios = require('axios');
const response = await axios.get(
'https://backend.kridtech.com/api/calls',
{
params: { status: 'completed', limit: 10 },
headers: { 'x-api-key': 'YOUR_API_KEY' }
}
);
console.log(response.data);
import requests
url = 'https://backend.kridtech.com/api/calls'
headers = { 'x-api-key': 'YOUR_API_KEY' }
params = { 'status': 'completed', 'limit': 10 }
response = requests.get(url, headers=headers, params=params)
print(response.json())
Response
{
"success": true,
"calls": [
{
"callId": "call_abc123",
"accountId": "your-account-id",
"direction": "outbound",
"toNumber": "+1234567890",
"callStatus": "completed",
"duration": 125,
"cost": 45,
"createdAt": "2025-02-14T10:30:00Z",
"firstName": "John"
}
],
"total": 1
}
Response Codes
Webhooks
Kridtech can POST a real-time event to any HTTPS endpoint you own immediately after a call is analyzed. Webhooks let you react to completed calls without polling the API — pipe data into your CRM, trigger follow-up automations, or store transcripts in your own database.
Quantum & Webhook flag required
Webhooks are delivered only when both conditions are true on your account: You are on the Quantum and a valid webhookUrl is configured. You can set these from the Settings → API Keys & Webhooks page.
How it works
After every call that reaches the call_analyzed state, Kridtech sends a single POST request to your configured URL with a JSON body describing the completed call. The request times out after 10 seconds; your endpoint should respond with any 2xx status to acknowledge receipt.
Delivery guarantee
Webhook delivery is best-effort — if your server is unreachable or returns a non-2xx status, the event is not automatically retried. We recommend making your endpoint idempotent using the callId field as a deduplication key.
Security
All webhook URLs must use https://. Plain HTTP endpoints are rejected at save time. We recommend validating the callId against your own records to prevent spoofed payloads.
Payload Reference
Kridtech sends the following JSON body to your endpoint. All fields are always present; unavailable values are null.
Fields
| Field | Type | Description |
|---|---|---|
| callId | string | Unique identifier for the call. Use this as your idempotency key. |
| status | string | Always "completed" for webhook events (only sent after analysis). |
| durationMs | number | null | Total call duration in milliseconds, derived from end_timestamp − start_timestamp. |
| transcript | string | null | Full plain-text transcript of the call. For Quantum accounts this is the Gemini-processed transcript; for Core accounts it is the raw transcript. |
| recordingUrl | string | null | Publicly accessible URL to the call recording audio file. Available for a limited time. |
| dynamicVariables | array | null | The dynamic variable array associated with the call at time of completion. For Quantum accounts this reflects any variables updated by the AI during the call. |
Example Payload
{
"callId": "call_abc123",
"status": "completed",
"durationMs": 94000,
"transcript": "Agent: Hi, this is Sarah from Acme...\nUser: Hey, yes I was expecting your call...",
"recordingUrl": "https://storage.kridtech.com/recordings/call_abc123.mp3",
"dynamicVariables": [
{ "variable": "first_name", "value": "James" },
{ "variable": "budget", "value": "$15,000" }
]
}
Request Headers sent by Kridtech
| Header | Value |
|---|---|
| Content-Type | application/json |
| Content-Length | Byte length of the JSON body |
Setup & Testing
Configure your webhook URL from the Settings page, then verify delivery using the examples below.
1 — Configure your URL
Navigate to Settings → API Keys & Webhooks and paste your endpoint URL into the Webhook URL field. The URL must begin with https://. Click Save — this sets webhookUrl and flips webhook: true on your account immediately.
2 — Receive & acknowledge
Your endpoint must return any 2xx HTTP status within 10 seconds. A minimal receiver looks like this:
const express = require('express');
const app = express();
app.use(express.json());
app.post('/webhook', (req, res) => {
const { callId, status, durationMs, transcript, dynamicVariables } = req.body;
console.log(`Call ${callId} completed — ${durationMs}ms`);
// TODO: write to your CRM, trigger follow-up, etc.
res.sendStatus(200); // acknowledge within 10 s
});
app.listen(3000);
from flask import Flask, request
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
data = request.get_json()
call_id = data.get('callId')
duration_ms = data.get('durationMs')
transcript = data.get('transcript')
print(f"Call {call_id} — {duration_ms}ms")
# TODO: write to your CRM, trigger follow-up, etc.
return '', 200 # acknowledge within 10 s
if __name__ == '__main__':
app.run(port=3000)
# Simulate a Kridtech webhook delivery against your local server
curl -X POST https://your-server.com/webhook \
-H "Content-Type: application/json" \
-d '{
"callId": "call_test123",
"status": "completed",
"durationMs": 94000,
"transcript": "Agent: Hi...\nUser: Hello...",
"recordingUrl": null,
"dynamicVariables": [
{ "variable": "first_name", "value": "James" }
]
}'
Local development
Kridtech must be able to reach your URL over the public internet. For local testing use a tunnelling tool such as ngrok or cloudflared tunnel to expose your localhost and use the resulting HTTPS URL in the Settings page.