REST API Reference for AI Calls & SMS

API Documentation

REST API for lead ingestion and webhooks

Getting Started

The VoiceCRM API lets you push leads into your campaigns and receive webhooks when calls complete. All requests use HTTPS, accept JSON, and require an API key.

Base URL: https://thevoicecrm.com/api

Authentication

Generate API keys in Settings → Integrations. Keys are scoped to your organization and can be revoked at any time.

Include your key in the Authorization header on every request:

Authorization: Bearer YOUR_API_KEY

Lead Ingestion

POST
/api/v1/leads/ingest

Create a new lead. If a campaign with auto-call is configured, the lead will be queued automatically.

Request body

firstName*stringLead's first name
lastNamestringLead's last name
phone*stringE.164 format, e.g. +14165551234
emailstringLead's email address
sourcestringLead source label (website, facebook, referral...)
utm_sourcestringUTM source for attribution
utm_mediumstringUTM medium
utm_campaignstringUTM campaign
campaignIdstringForce assignment to a specific campaign
assignedTostringUser ID to assign the lead to
notesstringFree-form notes
customFieldsobjectIndustry-specific extra fields

Examples

curl -X POST https://thevoicecrm.com/api/v1/leads/ingest \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Doe",
    "phone": "+14165551234",
    "email": "jane@example.com",
    "source": "website",
    "utm_source": "google",
    "utm_medium": "cpc",
    "notes": "Requested a demo"
  }'
const response = await fetch("https://thevoicecrm.com/api/v1/leads/ingest", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    firstName: "Jane",
    lastName: "Doe",
    phone: "+14165551234",
    email: "jane@example.com",
    source: "website",
  }),
});
const lead = await response.json();
console.log(lead.id);
import requests

response = requests.post(
    "https://thevoicecrm.com/api/v1/leads/ingest",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "firstName": "Jane",
        "lastName": "Doe",
        "phone": "+14165551234",
        "email": "jane@example.com",
        "source": "website",
    },
)
lead = response.json()
print(lead["id"])

Response (201 Created)

{
  "id": "lead_abc123",
  "status": "queued",
  "campaignId": "camp_xyz",
  "createdAt": "2026-04-18T15:30:00Z"
}

REST API v1

Full read/write access to your CRM data. Authenticate with X-API-Key or Authorization: Bearer. List endpoints support limit (max 200) and offset query params.

Response envelope

// List endpoints
{
  "data": [ ... ],
  "pagination": { "limit": 50, "offset": 0, "returned": 50, "hasMore": true }
}

// Errors are always explicit — never silent empty responses
{
  "error": { "code": "rate_limited", "message": "Rate limit exceeded. Maximum 60 requests per minute." }
}

Endpoints

GET
/api/v1/leadsList leads. Filters: status, campaignId, search
GET
/api/v1/leads/:idGet one lead
POST
/api/v1/leadsCreate a lead (409 on duplicate phone)
PATCH
/api/v1/leads/:idUpdate lead fields (firstName, lastName, email, phone, status, tags, notes, smsOptIn...)
POST
/api/v1/leads/:id/callQueue an AI call to the lead (respects business hours, daily limits, and plan minutes)
GET
/api/v1/callsList calls with transcript, summary, and callResult. Filter: contactId
GET
/api/v1/smsList SMS messages. Filters: contactId, direction
GET
/api/v1/appointmentsList appointments. Filter: contactId
GET
/api/v1/campaignsList campaigns
POST
/api/v1/campaigns/:id/leadsAdd a lead to a campaign (body: { leadId })

Examples

List interested leads

curl "https://thevoicecrm.com/api/v1/leads?limit=25&offset=0&status=interested" \
  -H "X-API-Key: YOUR_API_KEY"

Create a lead in a campaign

curl -X POST https://thevoicecrm.com/api/v1/leads \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "firstName": "Jane", "lastName": "Doe", "phone": "+14165551234", "campaignId": "CAMPAIGN_ID" }'

Trigger an AI call

curl -X POST https://thevoicecrm.com/api/v1/leads/LEAD_ID/call \
  -H "X-API-Key: YOUR_API_KEY"

Outbound Webhooks

Configure webhook endpoints in Settings → Integrations to receive real-time events. All payloads are signed with HMAC-SHA256.

Available events

  • lead.created — New lead added
  • lead.updated — Lead fields changed
  • lead.status_changed — Lead status moved
  • call.completed — Call ended (any outcome)
  • appointment.booked — Appointment scheduled by the AI
  • sms.received — Inbound SMS received
  • deal.created / deal.won — Deal pipeline events

Example payload

{
  "event": "call.completed",
  "timestamp": "2026-04-18T15:30:00Z",
  "data": {
    "callId": "call_abc123",
    "leadId": "lead_xyz789",
    "duration": 187,
    "outcome": "appointment_booked",
    "qaScore": 92,
    "transcript": "...",
    "recordingUrl": "https://..."
  }
}

Verifying signatures (Node.js)

import crypto from "crypto";

function verifyWebhook(rawBody, signature, secret) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(rawBody)
    .digest("hex");
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// In your Express handler (use the RAW request body, not re-serialized JSON):
app.post("/your-webhook-endpoint", express.raw({ type: "application/json" }), (req, res) => {
  const signature = req.headers["x-webhook-signature"];
  if (!verifyWebhook(req.body, signature, process.env.WEBHOOK_SECRET)) {
    return res.status(401).send("Invalid signature");
  }
  const event = JSON.parse(req.body);
  // Process event.event / event.data ...
  res.json({ ok: true });
});

Every request includes X-Webhook-Signature (HMAC-SHA256 of the raw body with your subscription's secret), X-Webhook-Event, and X-Webhook-Id headers. Failed deliveries are retried immediately (3 quick attempts), then handed to a durable retry queue with exponential backoff (5 more attempts over ~24 hours). Every attempt is visible in the delivery log in Settings → Integrations → Outbound Webhooks. After 10 consecutive failures a webhook is auto-disabled.

Zapier & Make Setup

Receive VoiceCRM events in Zapier (trigger)

  1. In Zapier, create a Zap with trigger Webhooks by Zapier → Catch Hook and copy the hook URL.
  2. In VoiceCRM, go to Settings → Integrations → Outbound Webhooks, add a webhook with that URL and pick your events (e.g. call.completed, appointment.booked).
  3. Trigger a test event (create a lead or complete a call), then map the data fields in Zapier to Google Sheets, Slack, Gmail — anything.

Push data into VoiceCRM from Zapier (action)

  1. Add an action Webhooks by Zapier → Custom Request.
  2. Method POST, URL https://thevoicecrm.com/api/v1/leads, header X-API-Key: YOUR_API_KEY.
  3. JSON body with mapped fields: firstName, phone, optional campaignId to drop the lead straight into an AI calling campaign.
  4. Optionally add a second Custom Request to POST /api/v1/leads/{{leadId}}/call to dial immediately.

Make (Integromat)

  1. Incoming events: use the Webhooks → Custom webhook module, paste its URL into a VoiceCRM outbound webhook the same way as Zapier.
  2. Outgoing requests: use the HTTP → Make a request module with the same URL, header, and JSON body shown above.

No marketplace app needed — everything works with Zapier's and Make's built-in webhook/HTTP modules plus your API key.

Errors & Rate Limits

All v1 errors return JSON with an error object containing a machine-readable code and a human message:

{ "error": { "code": "validation_error", "message": "Phone number must include area code (at least 10 digits)." } }
401
UnauthorizedMissing or invalid API key (missing_api_key, invalid_api_key)
403
ForbiddenSuspended org, outside business hours, or minutes exhausted
404
Not FoundResource doesn't exist or belongs to another organization
409
ConflictDuplicate lead phone or call already queued
422
Validation ErrorMissing or invalid fields
429
Rate LimitedToo many requests (60/min default; X-RateLimit headers included)
500
Server ErrorSomething went wrong on our end

Need higher limits? Contact us