Skip to content
Back to home

Developers

LeadVex API

Connect a dealership's LeadVex workspace to your website, DMS, CRM, Zapier or Make: push leads and stock, book test drives, answer customers and get signed webhooks when something happens.

Version
1.2.0
Base URL
https://api.leadvexai.com/api
OpenAPI
Download the OpenAPI specOpenAPI 3.1, for Postman, Insomnia or a code generator

Introduction

The LeadVex API lets your systems work with a dealership's LeadVex workspace: push leads from your website or DMS, keep the stock in sync, book test drives, read and answer conversations, and get notified the moment something happens. It is the same API the LeadVex apps use.

Base URL: https://api.leadvexai.com/api. Send and receive JSON (UTF-8). IDs are UUIDs. Times are ISO 8601 with a timezone offset; responses use UTC. A token belongs to one dealership, so you never pass a dealership ID.

curl
curl https://api.leadvexai.com/api/api-tokens/current \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

With Zapier or Make you need no code: use "Webhooks by Zapier" (or Make's HTTP module) with the requests below to send data, and a "Catch Hook" (or Make's custom webhook) URL as a LeadVex webhook endpoint to receive it.

Authentication

Every request carries an API token in the Authorization header: Authorization: Bearer lvx_.... The dealership owner, or a member with the Integrations permission, creates tokens in LeadVex under Integrations > API tokens. A token is shown once, expires after at most 366 days and can be revoked there at any time. Keep it on your server: never put it in a website or a mobile app.

API access and webhooks are part of the Enterprise plan. Without them every call answers 403 with "code": "feature_not_in_plan".

A token can do only what its scopes allow, and never more than the person who created it may do today. Pick the fewest scopes your integration needs:

ScopeAllows
leads:viewRead leads assigned to the token creator and unassigned leads.
leads:view_allRead every lead, also other salespeople's.
leads:manageCreate and update leads, their notes and tags.
customers:viewRead customers.
customers:view_contact_detailsSee phones and emails unmasked.
customers:manageCreate and update customers.
customers:manage_consentRecord a customer's marketing opt-in.
customers:manage_dncrPut a customer on the Do Not Call Register or take them off it.
conversations:viewRead conversations and their messages.
messages:sendSend messages to customers.
bookings:viewRead the token creator's bookings and free slots.
bookings:view_allRead every salesperson's bookings.
bookings:manageBook, reschedule and cancel test drives.
inventory:viewRead the stock.
inventory:manageAdd, update and remove vehicles.
integrations:manageManage webhook endpoints.

A token acts for an integration, not as a person. It cannot sign in, change passwords or 2FA, create tokens, invite people or change their permissions, change the plan or payment, or connect a calendar: those answer 403 interactive user session required.

Errors

Errors use HTTP status codes and a JSON body with a detail field. detail is a sentence, an object with a stable code you can branch on and a message, or (422) a list of field problems.

{"detail": "missing required permission"}
StatusMeaning
400The request is malformed, for example an invalid Idempotency-Key.
401The token is missing, wrong, expired or revoked.
403The token lacks a scope, the plan does not include the feature, or the action needs a person.
404The record does not exist in this dealership, or the token may not see it.
409The request conflicts with the current state: a duplicate phone, a taken slot, a closed WhatsApp window, an Idempotency-Key still in use.
422A field is missing or invalid. detail lists each problem with its location.
429Too many requests. Wait the number of seconds in Retry-After.
500Our fault. correlation_id identifies the error for our support team.
503A provider the request needs (a calendar, a channel) is unavailable. Retry later.

Every response has an X-Correlation-ID header. Quote it when you contact support about a request.

Rate limits

Each token may make 300 requests per minute. Over that the API answers 429 with a Retry-After header: wait that many seconds and continue. Limits are per token, so one busy integration does not slow down another.

  • Pages hold at most 200 items.
  • POST /vehicles/import takes up to 500 vehicles at once: use it instead of one call per car.
  • A dealership can have up to 10 webhook endpoints. Prefer webhooks to polling for changes.

Pagination

Lists take limit (1 to 200, default 50) and offset, and answer {"items": [...], "total": n}. Fetch pages until offset reaches total.

Messages in a conversation are paged with a cursor instead, newest first: pass the next_cursor you got back as cursor to get older messages. next_cursor is null on the oldest page.

Python
import os

import requests

API = "https://api.leadvexai.com/api"
HEADERS = {"Authorization": f"Bearer {os.environ['LEADVEX_TOKEN']}"}

leads, offset = [], 0
while True:
    page = requests.get(f"{API}/leads/", headers=HEADERS,
                        params={"status": "new", "limit": 200, "offset": offset}, timeout=30)
    page.raise_for_status()
    body = page.json()
    leads += body["items"]
    offset += len(body["items"])
    if not body["items"] or offset >= body["total"]:
        break

Idempotency

A network error can leave you unsure whether a POST went through. Send an Idempotency-Key header (any unique string up to 255 characters, a UUID works well) with every POST. If you retry with the same key, LeadVex returns the first answer again with Idempotent-Replayed: true instead of creating a second lead, customer, booking or message.

  • Keys belong to your token and are kept for 24 hours after the first successful request.
  • Only successful (2xx) answers are kept. After an error you can fix the request and retry with the same key.
  • The same key with a different body, path or query answers 422 idempotency_key_reused.
  • While the first request is still running, a retry answers 409 idempotency_request_in_progress with Retry-After: 1.
  • GET, PATCH, PUT and DELETE are safe to repeat and need no key.
curl
curl -X POST https://api.leadvexai.com/api/customers/ \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: form-submission-84311" \
  -d '{"name": "Sara Al Mansoori", "phone": "+971501234567"}'

Webhooks

A webhook endpoint is an HTTPS URL of yours that LeadVex calls when something happens. Create one in LeadVex under Integrations > Webhooks, or with POST /webhook-endpoints/, and pick its events. Every event is a POST with a JSON body:

Body
{
  "id": "<delivery id>",
  "event": "lead.created",
  "dealership_id": "<uuid>",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": { ... }
}
HeaderValue
X-LeadVex-EventThe event type, as in the body.
X-LeadVex-DeliveryThe delivery ID, as id in the body. A retry carries the same ID.
X-LeadVex-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256>. See Signatures.
User-AgentLeadVex-Webhooks/1.0
  • Answer with any 2xx status within 10 seconds. Do the real work after you answer.
  • A failed delivery is retried up to 8 times in all, after 30 s, 2 min, 10 min, 30 min, 60 min, 180 min, 360 min (about 11 hours).
  • After 20 deliveries in a row fail, the endpoint is turned off and the owner sees why. Turn it on again from LeadVex or with PATCH /webhook-endpoints/{id}.
  • Deliveries can arrive more than once and out of order. Skip an id you have already processed, and use occurred_at to order events.
  • data is a snapshot of the records when the event was queued. Fetch the record through the API when you need its latest state.
  • Send a signed ping to check your endpoint: the "Send test" button in LeadVex, or POST /webhook-endpoints/{id}/test. The delivery log shows every attempt and your answer.

A workflow in LeadVex can also call an endpoint with its "Send to webhook" step. Those deliveries have the event workflow.step. The Webhooks section lists every event with an example payload.

Signatures

Check every delivery before you trust it. The X-LeadVex-Signature header is t=<timestamp>,v1=<signature>. v1 is the hex HMAC-SHA256 of the string <timestamp>.<raw body> with your endpoint's signing secret (whsec_..., shown once when you create the endpoint or rotate the secret) as the key.

  • Use the raw request body, byte for byte, before any JSON parsing.
  • Compare in constant time.
  • Reject a timestamp more than 5 minutes from your clock: that stops replays.
import hashlib
import hmac
import time


def verify_leadvex_signature(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
    """True when X-LeadVex-Signature matches the raw request body."""
    try:
        parts = dict(item.split("=", 1) for item in header.split(","))
        timestamp = int(parts["t"])
        received = parts["v1"]
    except (KeyError, ValueError):
        return False
    if abs(time.time() - timestamp) > tolerance:
        return False  # too old, or a replay
    signed = f"{timestamp}.".encode() + body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, received)


# Flask:
#   ok = verify_leadvex_signature(SECRET, request.headers["X-LeadVex-Signature"], request.get_data())

Versioning

This is version 1 of the API (1.2.0). Within a version we only make changes that do not break a correct integration, and we list each one in the changelog:

  • new endpoints, and new optional request fields and query parameters;
  • new fields in responses and in webhook data;
  • new event types, and new values in lists such as lead sources, channels and statuses.

Ignore fields and values you do not know. We never remove or rename a field, change its type, make an optional field required or change what an error means within a version. If we need to, that becomes a new version under a new base path. The current version keeps working for at least 6 months after we announce its successor here and by email to the owners of active tokens. Anything we plan to retire is marked deprecated in this reference first.

Token

Check the token an integration uses.

Check your token

GET /api-tokens/current

Returns the token you call with: its name, what it may do now and its expiry date. Use it to check a connection, for example in the "test" step of a Zapier or Make connection.

scopes are the token's scopes capped by its creator's current permissions. If the creator loses a permission, the token loses it too.

ScopesAny API token

Response 200
{
  "id": "7b9d1f3a-5c7e-4a2b-8d6f-0e2c4a6b8d13",
  "name": "Zapier",
  "scopes": [
    "customers:manage",
    "customers:view",
    "leads:manage",
    "leads:view"
  ],
  "expires_at": "2027-02-23T08:00:00+00:00",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "dealership_name": "Al Quoz Motors"
}

Code samples

curl "https://api.leadvexai.com/api/api-tokens/current" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
Called with a signed-in session instead of an API token.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Leads

Sales opportunities: one per customer interest, with a status from new to won or lost.

List leads

GET /leads/

Newest first by default. Without leads:view_all a token sees the leads assigned to its creator and the unassigned ones.

Scopesleads:view

Parameters

NameTypeDescription
statusOptionalone of new, contacted, qualified, test_drive, negotiation, won, lostOnly leads in this status.
agent_idOptionaluuidOnly leads assigned to this salesperson.
unassignedOptionalbooleanOnly leads nobody is assigned to.
created_fromOptionaldate-timeCreated at or after this time (ISO 8601 with a timezone).
created_toOptionaldate-timeCreated before this time (ISO 8601 with a timezone).
searchOptionalstringPart of the customer's name or phone.
from_adOptionalbooleanOnly leads that came from a Meta ad.
ad_idOptionalstringOnly leads from this ad ID.
sortOptionalone of created, activity, scorecreated (newest first), activity (latest activity first) or score (highest first).
limitOptionalintegerPage size, 1 to 200. Default 50.
offsetOptionalintegerHow many items to skip. Default 0.
branch_idOptionaluuidOnly this showroom. Without it you get every branch the token may see.
Response 200
{
  "items": [
    {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "customer": {
        "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
        "name": "Sara Al Mansoori",
        "phone": "+971501234567",
        "email": "sara@example.com",
        "username": null
      },
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "status": "qualified",
      "source": "website",
      "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02",
      "score": 72,
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "budget_kind": "total",
      "budget_min": null,
      "budget_max": null,
      "monthly_payment_budget": null,
      "preferences": [
        "white",
        "4x4"
      ],
      "objections": [],
      "deal_amount": null,
      "deal_currency": null,
      "revision": 4,
      "field_provenance": {},
      "timeline": "this month",
      "tags": [
        "finance"
      ],
      "notes": [
        {
          "text": "Asked about the 5-year service package",
          "author_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
          "author_name": "Omar Haddad",
          "created_at": "2026-11-21T10:02:11+00:00"
        }
      ],
      "score_factors": [
        {
          "code": "car_interest",
          "label": "Knows which car they want",
          "weight": 25
        },
        {
          "code": "budget",
          "label": "Shared a budget",
          "weight": 25
        }
      ],
      "last_activity_at": "2026-11-24T16:40:05+00:00",
      "created_at": "2026-11-20T09:12:44+00:00",
      "ad_referral": null,
      "custom_fields": {},
      "lead_form": null
    }
  ],
  "total": 128
}

Code samples

curl "https://api.leadvexai.com/api/leads/?status=new&limit=50" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Create a lead

POST /leads/

Creates a lead for an existing customer (create the customer first). The lead starts as new. Pass assigned_agent_id to assign it, otherwise it stays unassigned. Fires the lead.created webhook.

budget is a whole amount in US dollars, the currency LeadVex reports in.

Scopesleads:manage

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
customer_idRequireduuid
sourceOptionalstring
branch_idOptionaluuid
car_interestOptionalarray of any
budgetOptionalinteger
timelineOptionalstring
assigned_agent_idOptionaluuid
tagsOptionalarray of string
Example: request body
{
  "customer_id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
  "source": "website",
  "car_interest": [
    "Nissan Patrol 2025"
  ],
  "budget": 75000,
  "timeline": "this month",
  "tags": [
    "finance"
  ]
}
Response 201
{
  "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
}

Code samples

curl -X POST "https://api.leadvexai.com/api/leads/" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "customer_id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
  "source": "website",
  "car_interest": [
    "Nissan Patrol 2025"
  ],
  "budget": 75000,
  "timeline": "this month",
  "tags": [
    "finance"
  ]
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
The customer, branch or salesperson is not in this dealership.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Get a lead

GET /leads/{id}

One lead with its customer, salesperson, notes, score and the ad that brought it in.

Scopesleads:view

Parameters

NameTypeDescription
idRequireduuidThe lead ID.
Response 200
{
  "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "customer": {
    "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
    "name": "Sara Al Mansoori",
    "phone": "+971501234567",
    "email": "sara@example.com",
    "username": null
  },
  "assigned_agent": {
    "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
    "name": "Omar Haddad"
  },
  "status": "qualified",
  "source": "website",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02",
  "score": 72,
  "car_interest": [
    "Nissan Patrol 2025"
  ],
  "budget": 75000,
  "budget_currency": "USD",
  "budget_kind": "total",
  "budget_min": null,
  "budget_max": null,
  "monthly_payment_budget": null,
  "preferences": [
    "white",
    "4x4"
  ],
  "objections": [],
  "deal_amount": null,
  "deal_currency": null,
  "revision": 4,
  "field_provenance": {},
  "timeline": "this month",
  "tags": [
    "finance"
  ],
  "notes": [
    {
      "text": "Asked about the 5-year service package",
      "author_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
      "author_name": "Omar Haddad",
      "created_at": "2026-11-21T10:02:11+00:00"
    }
  ],
  "score_factors": [
    {
      "code": "car_interest",
      "label": "Knows which car they want",
      "weight": 25
    },
    {
      "code": "budget",
      "label": "Shared a budget",
      "weight": 25
    }
  ],
  "last_activity_at": "2026-11-24T16:40:05+00:00",
  "created_at": "2026-11-20T09:12:44+00:00",
  "ad_referral": null,
  "custom_fields": {},
  "lead_form": null
}

Code samples

curl "https://api.leadvexai.com/api/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such lead, or the token may not see it.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Update a lead

PATCH /leads/{id}

Changes only the fields you send. Moving status fires lead.status_changed, and moving it to won also fires sale.won.

A field you set is locked against the AI assistant: it will not overwrite your value from the chat. List a field in unlock_fields to let the AI update it again. deal_amount is the sale price for a won lead.

Scopesleads:manage

Parameters

NameTypeDescription
idRequireduuidThe lead ID.

Request body

NameType
statusOptionalone of new, contacted, qualified, test_drive, negotiation, won, lost
sourceOptionalstring
car_interestOptionalarray of any
budgetOptionalinteger
budget_currencyOptionalstring
budget_kindOptionalstring
budget_minOptionalinteger
budget_maxOptionalinteger
monthly_payment_budgetOptionalinteger
preferencesOptionalarray of any
objectionsOptionalarray of any
timelineOptionalstring
deal_amountOptionalinteger
deal_currencyOptionalstring
custom_fieldsOptionalobject
unlock_fieldsOptionalarray of string
Example: request body
{
  "status": "test_drive",
  "budget": 80000,
  "timeline": "next week"
}
Response 200
{
  "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "customer": {
    "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
    "name": "Sara Al Mansoori",
    "phone": "+971501234567",
    "email": "sara@example.com",
    "username": null
  },
  "assigned_agent": {
    "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
    "name": "Omar Haddad"
  },
  "status": "test_drive",
  "source": "website",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02",
  "score": 72,
  "car_interest": [
    "Nissan Patrol 2025"
  ],
  "budget": 80000,
  "budget_currency": "USD",
  "budget_kind": "total",
  "budget_min": null,
  "budget_max": null,
  "monthly_payment_budget": null,
  "preferences": [
    "white",
    "4x4"
  ],
  "objections": [],
  "deal_amount": null,
  "deal_currency": null,
  "revision": 4,
  "field_provenance": {},
  "timeline": "next week",
  "tags": [
    "finance"
  ],
  "notes": [
    {
      "text": "Asked about the 5-year service package",
      "author_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
      "author_name": "Omar Haddad",
      "created_at": "2026-11-21T10:02:11+00:00"
    }
  ],
  "score_factors": [
    {
      "code": "car_interest",
      "label": "Knows which car they want",
      "weight": 25
    },
    {
      "code": "budget",
      "label": "Shared a budget",
      "weight": 25
    }
  ],
  "last_activity_at": "2026-11-24T16:40:05+00:00",
  "created_at": "2026-11-20T09:12:44+00:00",
  "ad_referral": null,
  "custom_fields": {},
  "lead_form": null
}

Code samples

curl -X PATCH "https://api.leadvexai.com/api/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "test_drive",
  "budget": 80000,
  "timeline": "next week"
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such lead, or the token may not see it.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Add a note to a lead

POST /leads/{id}/notes

Appends an internal note. Customers never see notes. The note is signed with the token creator's name.

Scopesleads:manage

Parameters

NameTypeDescription
idRequireduuidThe lead ID.

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
textRequiredstring
Example: request body
{
  "text": "Customer called back: wants the white Patrol, trade-in a 2018 Land Cruiser."
}
Response 200
{
  "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "customer": {
    "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
    "name": "Sara Al Mansoori",
    "phone": "+971501234567",
    "email": "sara@example.com",
    "username": null
  },
  "assigned_agent": {
    "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
    "name": "Omar Haddad"
  },
  "status": "qualified",
  "source": "website",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02",
  "score": 72,
  "car_interest": [
    "Nissan Patrol 2025"
  ],
  "budget": 75000,
  "budget_currency": "USD",
  "budget_kind": "total",
  "budget_min": null,
  "budget_max": null,
  "monthly_payment_budget": null,
  "preferences": [
    "white",
    "4x4"
  ],
  "objections": [],
  "deal_amount": null,
  "deal_currency": null,
  "revision": 4,
  "field_provenance": {},
  "timeline": "this month",
  "tags": [
    "finance"
  ],
  "notes": [
    {
      "text": "Asked about the 5-year service package",
      "author_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
      "author_name": "Omar Haddad",
      "created_at": "2026-11-21T10:02:11+00:00"
    },
    {
      "text": "Customer called back: wants the white Patrol, trade-in a 2018 Land Cruiser.",
      "author_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
      "author_name": "Omar Haddad",
      "created_at": "2026-11-25T08:40:00+00:00"
    }
  ],
  "score_factors": [
    {
      "code": "car_interest",
      "label": "Knows which car they want",
      "weight": 25
    },
    {
      "code": "budget",
      "label": "Shared a budget",
      "weight": 25
    }
  ],
  "last_activity_at": "2026-11-24T16:40:05+00:00",
  "created_at": "2026-11-20T09:12:44+00:00",
  "ad_referral": null,
  "custom_fields": {},
  "lead_form": null
}

Code samples

curl -X POST "https://api.leadvexai.com/api/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43/notes" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "text": "Customer called back: wants the white Patrol, trade-in a 2018 Land Cruiser."
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such lead, or the token may not see it.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Replace a lead's tags

PUT /leads/{id}/tags

Sets the complete list of tags. Send the current tags plus the new one to add a tag. Each new tag fires lead.tag_added.

Scopesleads:manage

Parameters

NameTypeDescription
idRequireduuidThe lead ID.

Request body

NameType
tagsRequiredarray of string
Example: request body
{
  "tags": [
    "finance",
    "trade-in"
  ]
}
Response 200
{
  "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "customer": {
    "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
    "name": "Sara Al Mansoori",
    "phone": "+971501234567",
    "email": "sara@example.com",
    "username": null
  },
  "assigned_agent": {
    "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
    "name": "Omar Haddad"
  },
  "status": "qualified",
  "source": "website",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02",
  "score": 72,
  "car_interest": [
    "Nissan Patrol 2025"
  ],
  "budget": 75000,
  "budget_currency": "USD",
  "budget_kind": "total",
  "budget_min": null,
  "budget_max": null,
  "monthly_payment_budget": null,
  "preferences": [
    "white",
    "4x4"
  ],
  "objections": [],
  "deal_amount": null,
  "deal_currency": null,
  "revision": 4,
  "field_provenance": {},
  "timeline": "this month",
  "tags": [
    "finance",
    "trade-in"
  ],
  "notes": [
    {
      "text": "Asked about the 5-year service package",
      "author_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
      "author_name": "Omar Haddad",
      "created_at": "2026-11-21T10:02:11+00:00"
    }
  ],
  "score_factors": [
    {
      "code": "car_interest",
      "label": "Knows which car they want",
      "weight": 25
    },
    {
      "code": "budget",
      "label": "Shared a budget",
      "weight": 25
    }
  ],
  "last_activity_at": "2026-11-24T16:40:05+00:00",
  "created_at": "2026-11-20T09:12:44+00:00",
  "ad_referral": null,
  "custom_fields": {},
  "lead_form": null
}

Code samples

curl -X PUT "https://api.leadvexai.com/api/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43/tags" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "tags": [
    "finance",
    "trade-in"
  ]
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such lead, or the token may not see it.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Customers

The people behind leads and conversations. A customer is unique by phone number.

List customers

GET /customers/

Newest first. Without customers:view_contact_details phones and emails come back masked (for example +971 50 ••• ••67 and s•••@example.com).

Scopescustomers:view

Parameters

NameTypeDescription
searchOptionalstringPart of the name, phone or email.
limitOptionalintegerPage size, 1 to 200. Default 50.
offsetOptionalintegerHow many items to skip. Default 0.
branch_idOptionaluuidOnly this showroom. Without it you get every branch the token may see.
Response 200
{
  "items": [
    {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": "sara@example.com",
      "locale": "ar",
      "channels": {
        "whatsapp": "971501234567"
      },
      "meta": {},
      "revision": 3,
      "field_provenance": {},
      "created_at": "2026-11-20T09:12:44+00:00",
      "marketing_opt_out_at": null,
      "marketing_opt_out_source": null,
      "marketing_opt_in_at": "2026-11-20T09:15:02+00:00",
      "marketing_opt_in_source": "api",
      "dncr_at": null,
      "dncr_source": null,
      "tags": [
        "website",
        "finance"
      ],
      "custom_fields": {
        "emirate": "Dubai"
      }
    }
  ],
  "total": 342
}

Code samples

curl "https://api.leadvexai.com/api/customers/?search=%2B97150&limit=20" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Create a customer

POST /customers/

A phone or an email is required. Phones are unique within a dealership: look the number up first, or handle the 409.

marketing_opt_in: true records the customer's consent to marketing messages with the source api. It needs customers:manage_consent. Send it only when the customer really agreed, for example with a ticked box on your form. dncr: true puts the customer on the Do Not Call Register and needs customers:manage_dncr.

Scopescustomers:manage

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
nameOptionalstring
phoneOptionalstring
emailOptionalstring
localeOptionalstring
tagsOptionalarray of string
custom_fieldsOptionalobject
marketing_opt_inOptionalboolean
dncrOptionalboolean
Example: request body
{
  "name": "Sara Al Mansoori",
  "phone": "+971501234567",
  "email": "sara@example.com",
  "locale": "ar",
  "tags": [
    "website"
  ],
  "marketing_opt_in": true
}
Response 201
{
  "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58"
}

Code samples

curl -X POST "https://api.leadvexai.com/api/customers/" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Sara Al Mansoori",
  "phone": "+971501234567",
  "email": "sara@example.com",
  "locale": "ar",
  "tags": [
    "website"
  ],
  "marketing_opt_in": true
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
marketing_opt_in or dncr without the matching scope.
409
Another customer already has this phone number.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Get a customer

GET /customers/{id}

One customer with their channels, consent state, tags and custom fields.

Scopescustomers:view

Parameters

NameTypeDescription
idRequireduuidThe customer ID.
Response 200
{
  "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
  "name": "Sara Al Mansoori",
  "phone": "+971501234567",
  "email": "sara@example.com",
  "locale": "ar",
  "channels": {
    "whatsapp": "971501234567"
  },
  "meta": {},
  "revision": 3,
  "field_provenance": {},
  "created_at": "2026-11-20T09:12:44+00:00",
  "marketing_opt_out_at": null,
  "marketing_opt_out_source": null,
  "marketing_opt_in_at": "2026-11-20T09:15:02+00:00",
  "marketing_opt_in_source": "api",
  "dncr_at": null,
  "dncr_source": null,
  "tags": [
    "website",
    "finance"
  ],
  "custom_fields": {
    "emirate": "Dubai"
  }
}

Code samples

curl "https://api.leadvexai.com/api/customers/6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such customer, or the token may not see it.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Update a customer

PATCH /customers/{id}

Changes only the fields you send. custom_fields are merged into the stored values, and a null value clears a field. marketing_opt_out: true unsubscribes the customer from marketing, and marketing_opt_in: true records their consent (needs customers:manage_consent). As on leads, the fields you set are locked against the AI assistant until you list them in unlock_fields.

Scopescustomers:manage

Parameters

NameTypeDescription
idRequireduuidThe customer ID.

Request body

NameType
nameOptionalstring
phoneOptionalstring
emailOptionalstring
localeOptionalstring
marketing_opt_outOptionalboolean
marketing_opt_inOptionalboolean
dncrOptionalboolean
tagsOptionalarray of string
custom_fieldsOptionalobject
unlock_fieldsOptionalarray of string
Example: request body
{
  "name": "Sara Al Mansoori",
  "locale": "en",
  "tags": [
    "website",
    "finance"
  ],
  "custom_fields": {
    "emirate": "Dubai"
  }
}
Response 200
{
  "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
  "name": "Sara Al Mansoori",
  "phone": "+971501234567",
  "email": "sara@example.com",
  "locale": "en",
  "channels": {
    "whatsapp": "971501234567"
  },
  "meta": {},
  "revision": 3,
  "field_provenance": {},
  "created_at": "2026-11-20T09:12:44+00:00",
  "marketing_opt_out_at": null,
  "marketing_opt_out_source": null,
  "marketing_opt_in_at": "2026-11-20T09:15:02+00:00",
  "marketing_opt_in_source": "api",
  "dncr_at": null,
  "dncr_source": null,
  "tags": [
    "website",
    "finance"
  ],
  "custom_fields": {
    "emirate": "Dubai"
  }
}

Code samples

curl -X PATCH "https://api.leadvexai.com/api/customers/6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Sara Al Mansoori",
  "locale": "en",
  "tags": [
    "website",
    "finance"
  ],
  "custom_fields": {
    "emirate": "Dubai"
  }
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such customer, or the token may not see it.
409
Another customer already has this phone number.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Conversations

WhatsApp, Instagram, Messenger, Telegram, email and website chat threads, and their messages.

List conversations

GET /conversations/

Newest activity first. Spam and snoozed threads are left out unless you ask for them.

Scopesconversations:view

Parameters

NameTypeDescription
statusOptionalone of open, pending, escalated, closedopen, pending, escalated or closed.
agent_idOptionaluuidOnly threads assigned to this salesperson.
customer_idOptionaluuidOnly this customer's threads.
unassignedOptionalbooleanOnly threads nobody is assigned to.
unreadOptionalbooleanOnly threads with unread customer messages.
channelOptionalstringwhatsapp, instagram, messenger, telegram, email or webchat.
searchOptionalstringPart of the customer's name, phone or email.
spamOptionalbooleanOnly threads marked as spam.
limitOptionalintegerPage size, 1 to 200. Default 50.
offsetOptionalintegerHow many items to skip. Default 0.
tag_idOptionaluuidOnly threads with this conversation tag.
mentionedOptionalbooleanOnly threads where the token creator was @mentioned in a note.
snoozedOptionalbooleanOnly snoozed threads.
lead_statusOptionalarray of one of new, contacted, qualified, test_drive, negotiation, won, lostOnly threads whose lead is in one of these statuses (repeat the parameter).
unrepliedOptionalbooleanOnly threads where the customer is waiting for an answer.
sortOptionalone of newest, oldest, waiting_longestnewest, oldest or waiting_longest.
branch_idOptionaluuidOnly this showroom. Without it you get every branch the token may see.
view_idOptionaluuidOnly the threads a saved inbox view lists (its id from the dealership app). Combines with the other filters.
filtersOptionalstringA view definition as JSON, with the same fields as a saved view, to filter without saving it. At most 4,000 characters.
Response 200
{
  "items": [
    {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "customer": {
        "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
        "name": "Sara Al Mansoori",
        "phone": "+971501234567",
        "email": "sara@example.com",
        "username": null
      },
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "lead_id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "channel": "whatsapp",
      "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02",
      "email_subject": null,
      "status": "open",
      "ai_enabled": true,
      "effective_mode": "auto",
      "human_control": false,
      "mode_reason": null,
      "context_revision": 7,
      "last_message_at": "2026-11-24T16:40:05+00:00",
      "last_message_preview": "Can I come for a test drive on Tuesday?",
      "unread_count": 1,
      "created_at": "2026-11-20T09:12:44+00:00",
      "assigned_at": "2026-11-20T09:13:02+00:00",
      "first_response_due_at": null,
      "first_responded_at": "2026-11-20T09:13:10+00:00",
      "next_response_due_at": "2026-11-24T16:55:05+00:00",
      "resolution_due_at": null,
      "human_wait_started_at": null,
      "human_wait_due_at": null,
      "resolved_at": null,
      "outcome": null,
      "closing_note": null,
      "loss_reason": null,
      "automation_revision": 1,
      "override_value": null,
      "override_expires_at": null,
      "next_transition_at": null,
      "pinned_config_version": null,
      "clarification_count": 0,
      "is_spam": false,
      "spam_at": null,
      "spam_reason": null,
      "tags": [
        {
          "id": "4a6c8e1b-3d5f-4a7c-9e2b-6d8f1a3c5e70",
          "name": "VIP"
        }
      ],
      "snoozed_until": null,
      "waiting_since": "2026-11-24T16:40:05+00:00"
    }
  ],
  "total": 57
}

Code samples

curl "https://api.leadvexai.com/api/conversations/?status=open&unread=true" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Get a conversation

GET /conversations/{id}

One thread with its customer, salesperson, response deadlines and open escalation.

Scopesconversations:view

Parameters

NameTypeDescription
idRequireduuidThe conversation ID.
Response 200
{
  "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
  "customer": {
    "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
    "name": "Sara Al Mansoori",
    "phone": "+971501234567",
    "email": "sara@example.com",
    "username": null
  },
  "assigned_agent": {
    "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
    "name": "Omar Haddad"
  },
  "lead_id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "channel": "whatsapp",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02",
  "email_subject": null,
  "status": "open",
  "ai_enabled": true,
  "effective_mode": "auto",
  "human_control": false,
  "mode_reason": null,
  "context_revision": 7,
  "last_message_at": "2026-11-24T16:40:05+00:00",
  "last_message_preview": "Can I come for a test drive on Tuesday?",
  "unread_count": 1,
  "created_at": "2026-11-20T09:12:44+00:00",
  "assigned_at": "2026-11-20T09:13:02+00:00",
  "first_response_due_at": null,
  "first_responded_at": "2026-11-20T09:13:10+00:00",
  "next_response_due_at": "2026-11-24T16:55:05+00:00",
  "resolution_due_at": null,
  "human_wait_started_at": null,
  "human_wait_due_at": null,
  "resolved_at": null,
  "outcome": null,
  "closing_note": null,
  "loss_reason": null,
  "automation_revision": 1,
  "override_value": null,
  "override_expires_at": null,
  "next_transition_at": null,
  "pinned_config_version": null,
  "clarification_count": 0,
  "is_spam": false,
  "spam_at": null,
  "spam_reason": null,
  "tags": [
    {
      "id": "4a6c8e1b-3d5f-4a7c-9e2b-6d8f1a3c5e70",
      "name": "VIP"
    }
  ],
  "snoozed_until": null,
  "waiting_since": null,
  "escalation": null,
  "spam_by": null
}

Code samples

curl "https://api.leadvexai.com/api/conversations/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such conversation, or the token may not see it.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

List messages

GET /conversations/{id}/messages

The newest messages first, limit at a time. Pass the next_cursor you got back as cursor to get the page before them. next_cursor is null on the oldest page.

Scopesconversations:view

Parameters

NameTypeDescription
idRequireduuidThe conversation ID.
cursorOptionalstringThe next_cursor from the previous page.
limitOptionalintegerPage size, 1 to 200. Default 50.
Response 200
{
  "items": [
    {
      "id": "e7c3a9f1-4b2d-4e8a-a6c5-3f1b9d7e2c84",
      "conversation_id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "sender_type": "customer",
      "sender_agent_id": null,
      "direction": "inbound",
      "body": "Can I come for a test drive on Tuesday?",
      "media": [],
      "status": null,
      "external_id": "wamid.HBgMOTcxNTAxMjM0NTY3FQIAEhgUM0E",
      "ai_config_id": null,
      "created_at": "2026-11-24T16:40:05+00:00",
      "error": null,
      "origin": null
    }
  ],
  "next_cursor": "eyJiZWZvcmUiOiIyMDI2LTExLTI0VDE2OjQwOjA1In0"
}

Code samples

curl "https://api.leadvexai.com/api/conversations/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17/messages?limit=50" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such conversation, or the token may not see it.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Send a message

POST /conversations/{id}/messages

Queues a reply on the conversation's channel. It is sent within seconds: status moves from queued to sent, delivered and read as the channel reports back.

WhatsApp accepts free text only within 24 hours of the customer's last message. After that, send an approved template: {"template": {"name": "test_drive_reminder", "language": "en", "components": [...]}}. The message is signed with the token creator as the agent and pauses the AI assistant on this thread, as when a salesperson replies.

Scopesmessages:send

Parameters

NameTypeDescription
idRequireduuidThe conversation ID.

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
bodyOptionalstring
mediaOptionalarray of OutboundMediaSend
templateOptionalWhatsAppTemplateSend
snippet_idOptionaluuid
original_bodyOptionalstring
Example: request body
{
  "body": "Hi Sara, Tuesday at 5 pm works. See you at Al Quoz!"
}
Response 201
{
  "id": "d3b5f7a9-c2e4-4b6d-8f1a-5c7e9b2d4f68",
  "conversation_id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
  "sender_type": "agent",
  "sender_agent_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
  "direction": "outbound",
  "body": "Hi Sara, Tuesday at 5 pm works. See you at Al Quoz!",
  "media": [],
  "status": "queued",
  "external_id": null,
  "ai_config_id": null,
  "created_at": "2026-11-24T16:44:12+00:00",
  "error": null,
  "origin": null
}

Code samples

curl -X POST "https://api.leadvexai.com/api/conversations/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17/messages" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "body": "Hi Sara, Tuesday at 5 pm works. See you at Al Quoz!"
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such conversation, or the token may not see it.
409
The WhatsApp 24-hour window is closed (send a template), or the channel is disconnected.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Test drives

Bookings with a salesperson, usually a test drive, and the free slots to book.

List bookings

GET /bookings/

Soonest first. Without bookings:view_all a token sees its creator's bookings only.

Scopesbookings:view

Parameters

NameTypeDescription
statusOptionalone of scheduled, rescheduled, cancelled, donescheduled, rescheduled, cancelled or done.
agent_idOptionaluuidOnly this salesperson's bookings.
mineOptionalbooleanOnly the token creator's bookings.
date_fromOptionaldate-timeStarts at or after this time (ISO 8601 with a timezone).
date_toOptionaldate-timeStarts before this time (ISO 8601 with a timezone).
limitOptionalintegerPage size, 1 to 200. Default 50.
offsetOptionalintegerHow many items to skip. Default 0.
branch_idOptionaluuidOnly this showroom. Without it you get every branch the token may see.
Response 200
{
  "items": [
    {
      "id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31",
      "scheduled_at": "2026-12-02T13:00:00+00:00",
      "ends_at": "2026-12-02T13:30:00+00:00",
      "duration_min": 30,
      "status": "scheduled",
      "title": "Test drive: Nissan Patrol",
      "location": "Al Quoz showroom",
      "agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "customer": {
        "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
        "name": "Sara Al Mansoori",
        "phone": "+971501234567",
        "email": "sara@example.com",
        "username": null
      },
      "lead_id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
      "template_id": null,
      "notes": "Bring Emirates ID and driving licence",
      "created_at": "2026-11-25T08:41:19+00:00",
      "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
    }
  ],
  "total": 9
}

Code samples

curl "https://api.leadvexai.com/api/bookings/?date_from=2026-12-01T00:00:00%2B04:00&date_to=2026-12-08T00:00:00%2B04:00" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Book a test drive

POST /bookings/

Books a time for a lead or a customer. scheduled_at must carry a timezone offset (UAE is +04:00). Pass agent_id to give it to a salesperson. The time may not overlap another booking of that salesperson or of the car, or a busy time in a connected calendar: get free times from GET /booking-slots/availability first. Fires booking.created, and the customer gets the usual confirmation and reminders. Without duration_min a booking lasts 30 minutes.

Scopesbookings:manage

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
scheduled_atRequireddate-time
template_idOptionaluuid
duration_minOptionalinteger
titleOptionalstring
locationOptionalstring
agent_idOptionaluuid
customer_idOptionaluuid
lead_idOptionaluuid
vehicle_idOptionaluuid
notesOptionalstring
branch_idOptionaluuid
Example: request body
{
  "scheduled_at": "2026-12-02T17:00:00+04:00",
  "lead_id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
  "duration_min": 30,
  "notes": "Bring Emirates ID and driving licence"
}
Response 201
{
  "id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31"
}

Code samples

curl -X POST "https://api.leadvexai.com/api/bookings/" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "scheduled_at": "2026-12-02T17:00:00+04:00",
  "lead_id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
  "duration_min": 30,
  "notes": "Bring Emirates ID and driving licence"
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
409
The salesperson or the car is already booked then (code is slot_taken, resource says which).
422
scheduled_at without a timezone, or neither lead_id nor customer_id.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Reschedule or update a booking

PATCH /bookings/{id}

Changes only the fields you send. A new scheduled_at makes the booking rescheduled and tells the customer. Set status to done after the drive.

Scopesbookings:manage

Parameters

NameTypeDescription
idRequireduuidThe booking ID.

Request body

NameType
scheduled_atOptionaldate-time
duration_minOptionalinteger
titleOptionalstring
locationOptionalstring
agent_idOptionaluuid
vehicle_idOptionaluuid
statusOptionalone of scheduled, rescheduled, cancelled, done
notesOptionalstring
Example: request body
{
  "scheduled_at": "2026-12-03T11:00:00+04:00"
}
Response 200
{
  "id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31",
  "scheduled_at": "2026-12-03T07:00:00+00:00",
  "ends_at": "2026-12-03T07:30:00+00:00",
  "duration_min": 30,
  "status": "rescheduled",
  "title": "Test drive: Nissan Patrol",
  "location": "Al Quoz showroom",
  "agent": {
    "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
    "name": "Omar Haddad"
  },
  "customer": {
    "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
    "name": "Sara Al Mansoori",
    "phone": "+971501234567",
    "email": "sara@example.com",
    "username": null
  },
  "lead_id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
  "template_id": null,
  "notes": "Bring Emirates ID and driving licence",
  "created_at": "2026-11-25T08:41:19+00:00",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
}

Code samples

curl -X PATCH "https://api.leadvexai.com/api/bookings/c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "scheduled_at": "2026-12-03T11:00:00+04:00"
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such booking, or the token may not see it.
409
The new time is taken.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Cancel a booking

DELETE /bookings/{id}

Marks the booking cancelled and returns it. The record stays for reports. Fires booking.cancelled.

Scopesbookings:manage

Parameters

NameTypeDescription
idRequireduuidThe booking ID.
reasonOptionalstringWhy it was cancelled, up to 500 characters. Shown to the team.
Response 200
{
  "id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31",
  "scheduled_at": "2026-12-02T13:00:00+00:00",
  "ends_at": "2026-12-02T13:30:00+00:00",
  "duration_min": 30,
  "status": "cancelled",
  "title": "Test drive: Nissan Patrol",
  "location": "Al Quoz showroom",
  "agent": {
    "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
    "name": "Omar Haddad"
  },
  "customer": {
    "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
    "name": "Sara Al Mansoori",
    "phone": "+971501234567",
    "email": "sara@example.com",
    "username": null
  },
  "lead_id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
  "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
  "template_id": null,
  "notes": "Bring Emirates ID and driving licence",
  "created_at": "2026-11-25T08:41:19+00:00",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
}

Code samples

curl -X DELETE "https://api.leadvexai.com/api/bookings/c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31?reason=Customer%20postponed" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such booking, or the token may not see it.
409
The booking is already cancelled, or done.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

List free slots

GET /booking-slots/availability

Free start times from the dealership's working hours, its salespeople's existing bookings and their connected calendars. At most 31 days at a time. Times are UTC: convert them for display.

Scopesbookings:view

Parameters

NameTypeDescription
date_fromOptionaldateFirst day (YYYY-MM-DD). Default today.
date_toOptionaldateLast day (YYYY-MM-DD). Default a week after date_from.
agent_idOptionaluuidOnly this salesperson's slots.
branch_idOptionaluuidOnly this showroom.
vehicle_idOptionaluuidLeave out times when this car is already booked.
Response 200
{
  "items": [
    {
      "agent_id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
      "start": "2026-12-02T13:00:00+00:00",
      "end": "2026-12-02T13:30:00+00:00",
      "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
    }
  ],
  "total": 1
}

Code samples

curl "https://api.leadvexai.com/api/booking-slots/availability?date_from=2026-12-01&date_to=2026-12-07" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Inventory

The cars in stock. Customers and the AI assistant see what you list here.

List vehicles

GET /vehicles/

Newest first. Every member sees the stock, so inventory:view is enough.

Scopesinventory:view

Parameters

NameTypeDescription
statusOptionalone of available, reserved, sold, archivedavailable, reserved, sold or archived.
price_minOptionalintegerLowest price.
price_maxOptionalintegerHighest price.
searchOptionalstringPart of the make or model.
limitOptionalintegerPage size, 1 to 200. Default 50.
offsetOptionalintegerHow many items to skip. Default 0.
branch_idOptionaluuidOnly this showroom. Without it you get every branch the token may see.
Response 200
{
  "items": [
    {
      "id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
      "status": "available",
      "price": 52000,
      "currency": "USD",
      "data": {
        "make": "Nissan",
        "model": "Patrol",
        "year": 2023,
        "condition": "used",
        "mileage": 42000,
        "color": "Pearl White",
        "transmission": "automatic",
        "fuel": "petrol",
        "body_type": "SUV",
        "trim": "LE Platinum",
        "vin": "JN8AY2NY0P9000001"
      },
      "photos": [
        "https://cdn.example.com/stock/patrol-2023-front.jpg"
      ],
      "created_at": "2026-11-18T07:30:00+00:00",
      "updated_at": "2026-11-24T12:05:31+00:00",
      "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
    }
  ],
  "total": 214
}

Code samples

curl "https://api.leadvexai.com/api/vehicles/?status=available&search=patrol" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Add a vehicle

POST /vehicles/

data needs make, model and year. A used car also needs mileage. Any other key you add to data (vin, trim, stock_number, ...) is kept and returned. price is a whole amount in currency (default USD).

Scopesinventory:manage

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
dataRequiredVehicleData
priceOptionalinteger
currencyOptionalstring
statusOptionalone of available, reserved, sold, archived
photosOptionalarray of string
branch_idOptionaluuid
branchOptionalstring
Example: request body
{
  "data": {
    "make": "Nissan",
    "model": "Patrol",
    "year": 2023,
    "condition": "used",
    "mileage": 42000,
    "color": "Pearl White",
    "transmission": "automatic",
    "fuel": "petrol",
    "body_type": "SUV",
    "trim": "LE Platinum",
    "vin": "JN8AY2NY0P9000001"
  },
  "price": 52000,
  "currency": "USD",
  "status": "available",
  "photos": [
    "https://cdn.example.com/stock/patrol-2023-front.jpg"
  ],
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
}
Response 201
{
  "id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19"
}

Code samples

curl -X POST "https://api.leadvexai.com/api/vehicles/" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "data": {
    "make": "Nissan",
    "model": "Patrol",
    "year": 2023,
    "condition": "used",
    "mileage": 42000,
    "color": "Pearl White",
    "transmission": "automatic",
    "fuel": "petrol",
    "body_type": "SUV",
    "trim": "LE Platinum",
    "vin": "JN8AY2NY0P9000001"
  },
  "price": 52000,
  "currency": "USD",
  "status": "available",
  "photos": [
    "https://cdn.example.com/stock/patrol-2023-front.jpg"
  ],
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A used car without mileage, or a missing make, model or year.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Add vehicles in bulk

POST /vehicles/import

Up to 500 vehicles in one request, for a first stock upload or a nightly sync from your DMS. All rows are checked first: if one is invalid, nothing is added. Each item can name its showroom by branch (the branch name, any case) instead of branch_id.

Scopesinventory:manage

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
itemsRequiredarray of VehicleCreate
Example: request body
{
  "items": [
    {
      "data": {
        "make": "Nissan",
        "model": "Patrol",
        "year": 2023,
        "condition": "used",
        "mileage": 42000,
        "color": "Pearl White",
        "transmission": "automatic",
        "fuel": "petrol",
        "body_type": "SUV",
        "trim": "LE Platinum",
        "vin": "JN8AY2NY0P9000001"
      },
      "price": 52000,
      "currency": "USD"
    },
    {
      "data": {
        "make": "Toyota",
        "model": "Land Cruiser",
        "year": 2025,
        "condition": "new"
      },
      "price": 89000,
      "currency": "USD",
      "branch": "Al Quoz"
    }
  ]
}
Response 201
{
  "created": 2
}

Code samples

curl -X POST "https://api.leadvexai.com/api/vehicles/import" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "items": [
    {
      "data": {
        "make": "Nissan",
        "model": "Patrol",
        "year": 2023,
        "condition": "used",
        "mileage": 42000,
        "color": "Pearl White",
        "transmission": "automatic",
        "fuel": "petrol",
        "body_type": "SUV",
        "trim": "LE Platinum",
        "vin": "JN8AY2NY0P9000001"
      },
      "price": 52000,
      "currency": "USD"
    },
    {
      "data": {
        "make": "Toyota",
        "model": "Land Cruiser",
        "year": 2025,
        "condition": "new"
      },
      "price": 89000,
      "currency": "USD",
      "branch": "Al Quoz"
    }
  ]
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Get a vehicle

GET /vehicles/{id}

One vehicle with all its details and photos.

Scopesinventory:view

Parameters

NameTypeDescription
idRequireduuidThe vehicle ID.
Response 200
{
  "id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
  "status": "available",
  "price": 52000,
  "currency": "USD",
  "data": {
    "make": "Nissan",
    "model": "Patrol",
    "year": 2023,
    "condition": "used",
    "mileage": 42000,
    "color": "Pearl White",
    "transmission": "automatic",
    "fuel": "petrol",
    "body_type": "SUV",
    "trim": "LE Platinum",
    "vin": "JN8AY2NY0P9000001"
  },
  "photos": [
    "https://cdn.example.com/stock/patrol-2023-front.jpg"
  ],
  "created_at": "2026-11-18T07:30:00+00:00",
  "updated_at": "2026-11-24T12:05:31+00:00",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
}

Code samples

curl "https://api.leadvexai.com/api/vehicles/1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such vehicle in this dealership.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Update a vehicle

PATCH /vehicles/{id}

Changes only the fields you send. data replaces the stored details as a whole: send all of them. Mark a sold car sold, so customers and the AI assistant stop offering it.

Scopesinventory:manage

Parameters

NameTypeDescription
idRequireduuidThe vehicle ID.

Request body

NameType
dataOptionalVehicleData
priceOptionalinteger
currencyOptionalstring
statusOptionalone of available, reserved, sold, archived
photosOptionalarray of string
branch_idOptionaluuid
Example: request body
{
  "price": 49500,
  "status": "reserved"
}
Response 200
{
  "id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
  "status": "reserved",
  "price": 49500,
  "currency": "USD",
  "data": {
    "make": "Nissan",
    "model": "Patrol",
    "year": 2023,
    "condition": "used",
    "mileage": 42000,
    "color": "Pearl White",
    "transmission": "automatic",
    "fuel": "petrol",
    "body_type": "SUV",
    "trim": "LE Platinum",
    "vin": "JN8AY2NY0P9000001"
  },
  "photos": [
    "https://cdn.example.com/stock/patrol-2023-front.jpg"
  ],
  "created_at": "2026-11-18T07:30:00+00:00",
  "updated_at": "2026-11-24T12:05:31+00:00",
  "branch_id": "5e9c1a7b-8d3f-4e2a-b6c4-1f7d3b9e5a02"
}

Code samples

curl -X PATCH "https://api.leadvexai.com/api/vehicles/1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "price": 49500,
  "status": "reserved"
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such vehicle in this dealership.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Remove a vehicle

DELETE /vehicles/{id}

Removes the car from the stock. Bookings and conversations that mention it keep their history. To keep the car in reports, set its status to sold or archived instead.

Scopesinventory:manage

Parameters

NameTypeDescription
idRequireduuidThe vehicle ID.

Code samples

curl -X DELETE "https://api.leadvexai.com/api/vehicles/1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such vehicle in this dealership.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Webhooks

Endpoints that receive signed event notifications from LeadVex.

List event types

GET /webhook-endpoints/events

The events an endpoint can subscribe to. The Webhooks section below describes each payload.

Scopesintegrations:manage

Response 200
{
  "events": [
    "lead.created",
    "lead.status_changed",
    "sale.won",
    "lead.tag_added",
    "conversation.opened",
    "conversation.assigned",
    "message.received",
    "booking.created",
    "booking.cancelled",
    "conversation.closed",
    "payment.paid",
    "call.completed"
  ]
}

Code samples

curl "https://api.leadvexai.com/api/webhook-endpoints/events" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Get sample payloads

GET /webhook-endpoints/events/{event}/sample

Up to three payloads of the newest real events of this type in your dealership, newest first, shaped exactly like the deliveries. Without such an event yet you get the documented example. The Zapier and Make apps show these in their "test trigger" step.

Scopesintegrations:manage

Parameters

NameTypeDescription
eventRequiredstringAn event name from GET /webhook-endpoints/events, for example lead.created.
Response 200
{
  "items": [
    {
      "id": "sample-0c7f9e2a-3b1d-4c5e-8f6a-7b9d1e3c5a24",
      "event": "lead.created",
      "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
      "occurred_at": "2026-11-25T08:41:19+00:00",
      "data": {
        "lead": {
          "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
          "status": "new",
          "source": "whatsapp",
          "score": 40,
          "tags": [],
          "car_interest": [
            "Nissan Patrol 2025"
          ],
          "budget": 75000,
          "budget_currency": "USD",
          "deal_amount": null,
          "deal_currency": null,
          "assigned_agent": {
            "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
            "name": "Omar Haddad"
          },
          "created_at": "2026-11-25T08:41:19+00:00",
          "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
        },
        "customer": {
          "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
          "name": "Sara Al Mansoori",
          "phone": "+971501234567",
          "email": null,
          "language": "ar"
        },
        "conversation": {
          "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
          "channel": "whatsapp",
          "status": "open",
          "assigned_agent": {
            "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
            "name": "Omar Haddad"
          },
          "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
        }
      }
    }
  ]
}

Code samples

curl "https://api.leadvexai.com/api/webhook-endpoints/events/{event}/sample" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
Not an event name from GET /webhook-endpoints/events.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Subscribe a REST hook

POST /webhook-endpoints/subscriptions

For no-code platforms: subscribes one URL to one event, as Zapier and Make do when a Zap or scenario is turned on. source is zapier or make and needs that app in your plan. Subscriptions are signed like endpoints, are listed with the endpoints (with their source) and do not count against the 10 endpoints; at most 100 per source. Only events after the subscription are sent.

Scopesintegrations:manage

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
target_urlRequiredstring
eventRequiredone of lead.created, lead.status_changed, sale.won, lead.tag_added, conversation.opened, conversation.assigned, message.received, booking.created, booking.cancelled, conversation.closed, payment.paid, call.completed
sourceRequiredone of zapier, make
Example: request body
{
  "target_url": "https://hooks.zapier.com/hooks/standard/123456/abcdef/",
  "event": "lead.created",
  "source": "zapier"
}
Response 201
{
  "id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
  "event": "lead.created",
  "target_url": "https://hooks.zapier.com/hooks/standard/123456/abcdef/",
  "source": "zapier",
  "created_at": "2026-11-25T08:00:00+00:00"
}

Code samples

curl -X POST "https://api.leadvexai.com/api/webhook-endpoints/subscriptions" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "target_url": "https://hooks.zapier.com/hooks/standard/123456/abcdef/",
  "event": "lead.created",
  "source": "zapier"
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
409
The dealership already has 100 subscriptions from this source.
422
The URL is not public HTTPS.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Unsubscribe a REST hook

DELETE /webhook-endpoints/subscriptions/{id}

Stops a subscription made with POST /webhook-endpoints/subscriptions. Endpoints made in LeadVex are not removed here (use DELETE /webhook-endpoints/{id}).

Scopesintegrations:manage

Parameters

NameTypeDescription
idRequireduuidThe subscription ID that POST /webhook-endpoints/subscriptions returned.

Code samples

curl -X DELETE "https://api.leadvexai.com/api/webhook-endpoints/subscriptions/a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such subscription.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

List endpoints

GET /webhook-endpoints/

Every endpoint with its delivery counts for the last 24 hours. Secrets are never shown again, only their last four characters.

Scopesintegrations:manage

Response 200
{
  "items": [
    {
      "id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
      "name": "Zapier: new leads",
      "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
      "events": [
        "lead.created",
        "booking.created"
      ],
      "is_active": true,
      "disabled_reason": null,
      "secret_hint": "Q2xz",
      "consecutive_failures": 0,
      "last_success_at": "2026-11-25T08:41:22+00:00",
      "last_failure_at": null,
      "delivered_24h": 18,
      "failed_24h": 0,
      "pending": 0,
      "source": "app",
      "created_at": "2026-11-19T10:00:00+00:00"
    }
  ],
  "total": 1
}

Code samples

curl "https://api.leadvexai.com/api/webhook-endpoints/" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Create an endpoint

POST /webhook-endpoints/

Subscribes an HTTPS URL to events. The response carries the signing secret once: store it to check signatures. The URL must be public HTTPS (no private or local addresses). At most 10 endpoints per dealership. Only events after the endpoint was created are sent.

Scopesintegrations:manage

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.

Request body

NameType
nameRequiredstring
urlRequiredstring
eventsRequiredarray of one of lead.created, lead.status_changed, sale.won, lead.tag_added, conversation.opened, conversation.assigned, message.received, booking.created, booking.cancelled, conversation.closed, payment.paid, call.completed
Example: request body
{
  "name": "Zapier: new leads",
  "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
  "events": [
    "lead.created",
    "booking.created"
  ]
}
Response 201
{
  "id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
  "name": "Zapier: new leads",
  "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
  "events": [
    "lead.created",
    "booking.created"
  ],
  "is_active": true,
  "disabled_reason": null,
  "secret_hint": "Q2xz",
  "consecutive_failures": 0,
  "last_success_at": null,
  "last_failure_at": null,
  "delivered_24h": 0,
  "failed_24h": 0,
  "pending": 0,
  "source": "app",
  "created_at": "2026-11-19T10:00:00+00:00",
  "secret": "whsec_3pWm7Yk2bQ9sV4xT8nL1cR6fJ0hG5dA2zE7uK9iO4Q2xz"
}

Code samples

curl -X POST "https://api.leadvexai.com/api/webhook-endpoints/" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Zapier: new leads",
  "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
  "events": [
    "lead.created",
    "booking.created"
  ]
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
409
The dealership already has 10 endpoints.
422
The URL is not public HTTPS.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Update an endpoint

PATCH /webhook-endpoints/{id}

Change the name, URL or events, or turn the endpoint off (is_active: false) and on again. Events from while it was off are not sent later. Turning it on also clears an automatic switch-off after 20 failed deliveries in a row.

Scopesintegrations:manage

Parameters

NameTypeDescription
idRequireduuidThe webhook endpoint ID.

Request body

NameType
nameOptionalstring
urlOptionalstring
eventsOptionalarray of one of lead.created, lead.status_changed, sale.won, lead.tag_added, conversation.opened, conversation.assigned, message.received, booking.created, booking.cancelled, conversation.closed, payment.paid, call.completed
is_activeOptionalboolean
Example: request body
{
  "events": [
    "lead.created",
    "lead.status_changed",
    "sale.won"
  ],
  "is_active": true
}
Response 200
{
  "id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
  "name": "Zapier: new leads",
  "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
  "events": [
    "lead.created",
    "lead.status_changed",
    "sale.won"
  ],
  "is_active": true,
  "disabled_reason": null,
  "secret_hint": "Q2xz",
  "consecutive_failures": 0,
  "last_success_at": "2026-11-25T08:41:22+00:00",
  "last_failure_at": null,
  "delivered_24h": 18,
  "failed_24h": 0,
  "pending": 0,
  "source": "app",
  "created_at": "2026-11-19T10:00:00+00:00"
}

Code samples

curl -X PATCH "https://api.leadvexai.com/api/webhook-endpoints/a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "events": [
    "lead.created",
    "lead.status_changed",
    "sale.won"
  ],
  "is_active": true
}'

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such endpoint.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Delete an endpoint

DELETE /webhook-endpoints/{id}

Stops all deliveries to the endpoint and removes it.

Scopesintegrations:manage

Parameters

NameTypeDescription
idRequireduuidThe webhook endpoint ID.

Code samples

curl -X DELETE "https://api.leadvexai.com/api/webhook-endpoints/a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such endpoint.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Rotate the signing secret

POST /webhook-endpoints/{id}/rotate-secret

Issues a new secret and returns it once. Deliveries from now on are signed with the new secret only, so update your receiver right away.

Scopesintegrations:manage

Parameters

NameTypeDescription
idRequireduuidThe webhook endpoint ID.

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.
Response 200
{
  "id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
  "name": "Zapier: new leads",
  "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
  "events": [
    "lead.created",
    "booking.created"
  ],
  "is_active": true,
  "disabled_reason": null,
  "secret_hint": "k7Rm",
  "consecutive_failures": 0,
  "last_success_at": "2026-11-25T08:41:22+00:00",
  "last_failure_at": null,
  "delivered_24h": 18,
  "failed_24h": 0,
  "pending": 0,
  "source": "app",
  "created_at": "2026-11-19T10:00:00+00:00",
  "secret": "whsec_8sJd2Lq9Vx4Ty7Ue1Wb6Nc3Pf0Mh5Zg2Ak7Rm"
}

Code samples

curl -X POST "https://api.leadvexai.com/api/webhook-endpoints/a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46/rotate-secret" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such endpoint.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Send a test event

POST /webhook-endpoints/{id}/test

Queues a signed ping event to the endpoint. It goes out within seconds. Check the result in the delivery log (GET /webhook-endpoints/{id}/deliveries).

Scopesintegrations:manage

Parameters

NameTypeDescription
idRequireduuidThe webhook endpoint ID.

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.
Response 202
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "endpoint_id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
  "event_type": "ping",
  "status": "pending",
  "attempts": 0,
  "response_status": null,
  "response_ms": null,
  "last_error": null,
  "next_attempt_at": "2026-11-25T08:45:00+00:00",
  "last_attempt_at": null,
  "delivered_at": null,
  "created_at": "2026-11-25T08:45:00+00:00",
  "payload": {
    "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
    "event": "ping",
    "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
    "occurred_at": "2026-11-25T08:45:00+00:00",
    "data": {
      "message": "Test event from LeadVex. Your endpoint is reachable."
    }
  }
}

Code samples

curl -X POST "https://api.leadvexai.com/api/webhook-endpoints/a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46/test" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such endpoint.
409
The endpoint is turned off.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

List deliveries

GET /webhook-endpoints/{id}/deliveries

The latest deliveries to the endpoint, newest first, with the exact payload and your server's answer. Deliveries are kept 30 days.

Scopesintegrations:manage

Parameters

NameTypeDescription
idRequireduuidThe webhook endpoint ID.
statusOptionalstringpending, delivering, succeeded or failed.
limitOptionalintegerHow many, 1 to 200. Default 50.
Response 200
{
  "items": [
    {
      "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
      "endpoint_id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
      "event_type": "ping",
      "status": "succeeded",
      "attempts": 1,
      "response_status": 200,
      "response_ms": 182,
      "last_error": null,
      "next_attempt_at": "2026-11-25T08:45:00+00:00",
      "last_attempt_at": "2026-11-25T08:45:03+00:00",
      "delivered_at": "2026-11-25T08:45:03+00:00",
      "created_at": "2026-11-25T08:45:00+00:00",
      "payload": {
        "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
        "event": "ping",
        "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
        "occurred_at": "2026-11-25T08:45:00+00:00",
        "data": {
          "message": "Test event from LeadVex. Your endpoint is reachable."
        }
      }
    }
  ],
  "total": 1
}

Code samples

curl "https://api.leadvexai.com/api/webhook-endpoints/a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46/deliveries?status=failed" \
  -H "Authorization: Bearer $LEADVEX_TOKEN"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such endpoint.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Send a delivery again

POST /webhook-endpoints/{id}/deliveries/{delivery_id}/redeliver

Queues a finished delivery again with the same id and payload, for example after fixing your receiver. Your receiver should skip ids it has already processed.

Scopesintegrations:manage

Parameters

NameTypeDescription
idRequireduuidThe webhook endpoint ID.
delivery_idRequireduuidThe delivery ID (X-LeadVex-Delivery).

Headers

NameTypeDescription
Idempotency-KeyOptionalstringAny unique string up to 255 characters. A retry with the same key returns the first answer instead of doing the work twice. See Idempotency.
Response 200
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "endpoint_id": "a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46",
  "event_type": "ping",
  "status": "pending",
  "attempts": 0,
  "response_status": 200,
  "response_ms": 182,
  "last_error": null,
  "next_attempt_at": "2026-11-25T08:45:00+00:00",
  "last_attempt_at": "2026-11-25T08:45:03+00:00",
  "delivered_at": "2026-11-25T08:45:03+00:00",
  "created_at": "2026-11-25T08:45:00+00:00",
  "payload": {
    "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
    "event": "ping",
    "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
    "occurred_at": "2026-11-25T08:45:00+00:00",
    "data": {
      "message": "Test event from LeadVex. Your endpoint is reachable."
    }
  }
}

Code samples

curl -X POST "https://api.leadvexai.com/api/webhook-endpoints/a1b3c5d7-e9f2-4a6c-8e1b-3d5f7a9c2e46/deliveries/f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35/redeliver" \
  -H "Authorization: Bearer $LEADVEX_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Errors

401
The token is missing, wrong, expired or revoked.
403
The token lacks a scope this request needs, or the plan does not include API access.
404
No such endpoint or delivery.
409
The delivery is still being sent.
422
A field is missing or invalid.
429
Too many requests for this token. Wait Retry-After seconds.
500
Something went wrong on our side.

Webhook events

Every delivery is a POST with this envelope, signed as described under Signatures. Subscribe an endpoint to the events you need; ping and workflow.step reach an endpoint whatever it subscribes to.

lead.created

A new lead

A lead was created in LeadVex, whatever its source (see lead.source). conversation is there when the lead came from a chat.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "lead.created",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    }
  }
}

lead.status_changed

A lead moved to another status

change.from and change.to are lead statuses: new, contacted, qualified, test_drive, negotiation, won or lost.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "lead.status_changed",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "test_drive",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "change": {
      "from": "qualified",
      "to": "test_drive"
    }
  }
}

sale.won

A sale

A lead moved to won. Use it to count sales or to send them to your accounting or DMS. lead.deal_amount is the sale price when the team recorded it.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "sale.won",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "won",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": 51000,
      "deal_currency": "USD",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "change": {
      "from": "negotiation",
      "to": "won"
    }
  }
}

lead.tag_added

A tag on a lead

A tag was added to a lead. tag is the new tag; lead.tags has them all.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "lead.tag_added",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [
        "finance"
      ],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "tag": "finance"
  }
}

conversation.opened

A new conversation

A customer started a new conversation. source is how they came: ad, link (a LeadVex link or QR code) or organic.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "conversation.opened",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "source": "ad"
  }
}

conversation.assigned

A conversation or lead was assigned

Routing or a person gave the conversation or the lead to a salesperson.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "conversation.assigned",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    }
  }
}

message.received

A customer message

A customer sent a message on any channel. Messages from the team and the AI are not sent.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "message.received",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "message": {
      "id": "e7c3a9f1-4b2d-4e8a-a6c5-3f1b9d7e2c84",
      "text": "Can I come for a test drive on Tuesday?",
      "channel": "whatsapp"
    }
  }
}

booking.created

A test drive was booked

A booking was made by the team, the AI assistant or the API.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "booking.created",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "booking": {
      "id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31",
      "status": "scheduled",
      "scheduled_at": "2026-12-02T13:00:00+00:00",
      "ends_at": "2026-12-02T13:30:00+00:00",
      "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
      "agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      }
    },
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    }
  }
}

booking.cancelled

A test drive was cancelled

A booking was cancelled. The booking stays in LeadVex with the status cancelled.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "booking.cancelled",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "booking": {
      "id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31",
      "status": "cancelled",
      "scheduled_at": "2026-12-02T13:00:00+00:00",
      "ends_at": "2026-12-02T13:30:00+00:00",
      "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
      "agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      }
    },
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    }
  }
}

conversation.closed

A conversation was closed

The team, or auto-close after a quiet period (closed.automatic), closed the conversation. closed.outcome is won, lost or no_outcome; closed.loss_reason says why a lost one was lost.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "conversation.closed",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "closed",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "closed": {
      "outcome": "lost",
      "loss_reason": "price",
      "automatic": false
    }
  }
}

payment.paid

A payment link was paid

A customer paid a deposit or reservation fee link on your payment provider's page, and the provider confirmed it. payment.amount is in payment.currency (AED); payment.purpose is deposit, reservation or other; payment.provider_reference is the id in your provider account. The money is in your own merchant account.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "payment.paid",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "payment": {
      "id": "8c1e3a5b-7d9f-4b2c-a6e8-0f2d4b6c8e1a",
      "status": "paid",
      "purpose": "deposit",
      "amount": 5000,
      "currency": "AED",
      "provider": "tap",
      "provider_reference": "chg_TS02A5720231234Xy9K2811443",
      "description": null,
      "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
      "paid_at": "2026-11-25T08:41:19+00:00",
      "created_at": "2026-11-25T08:02:44+00:00"
    }
  }
}

call.completed

A phone call ended

A call finished: answered by the AI phone agent, an outbound AI call, or a call your team logged. Missed and failed calls are sent too (call.status is completed, missed, no_answer or failed). call.summary is what the call was about and what was agreed; call.outcome is test_drive_booked, lead_updated, transferred, callback_requested, info_only, spam or unknown; call.handled_by is ai or human. call.agent is the salesperson the call was passed to, or who logged it. call.url_path opens the chat with the transcript. Test calls are not sent.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "call.completed",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "voice",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "booking": {
      "id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31",
      "status": "scheduled",
      "scheduled_at": "2026-12-02T13:00:00+00:00",
      "ends_at": "2026-12-02T13:30:00+00:00",
      "vehicle_id": "1d5f8b3e-7a2c-4c9e-8b4f-6e0a2d4c8f19",
      "agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      }
    },
    "call": {
      "id": "3e5a7c9b-2d4f-4a6b-8c1e-5f7a9b2d4c61",
      "direction": "inbound",
      "status": "completed",
      "outcome": "test_drive_booked",
      "end_reason": "caller_hangup",
      "started_at": "2026-11-25T08:36:02+00:00",
      "ended_at": "2026-11-25T08:41:19+00:00",
      "duration_sec": 317,
      "summary": "Asked about the Nissan Patrol 2025 in white, budget about 75,000 USD. Booked a test drive for Tuesday 17:00 at the Al Quoz showroom.",
      "handled_by": "ai",
      "transferred": false,
      "transfer_connected": false,
      "agent": null,
      "from_number": "+971501234567",
      "to_number": "+97142345678",
      "language": "ar",
      "booking_id": "c8a2e6f4-3d1b-4a7c-9e5d-8b2f0a6c4e31",
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    }
  }
}

ping

A test event

Sent by "Send test" in LeadVex or POST /webhook-endpoints/{id}/test, whatever events the endpoint subscribes to. Answer 2xx.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "ping",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "message": "Test event from LeadVex. Your endpoint is reachable."
  }
}

workflow.step

A workflow step

Sent by the "Send to webhook" step of a LeadVex workflow, whatever events the endpoint subscribes to. trigger is the event that started the workflow.

Payload
{
  "id": "f2d4b6a8-c1e3-4f5a-9b7d-2e4c6a8f1b35",
  "event": "workflow.step",
  "dealership_id": "0c2e4a6b-8d1f-4b3e-a5c7-9e1b3d5f7a24",
  "occurred_at": "2026-11-25T08:41:19+00:00",
  "data": {
    "lead": {
      "id": "3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43",
      "status": "new",
      "source": "whatsapp",
      "score": 40,
      "tags": [],
      "car_interest": [
        "Nissan Patrol 2025"
      ],
      "budget": 75000,
      "budget_currency": "USD",
      "deal_amount": null,
      "deal_currency": null,
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "created_at": "2026-11-25T08:41:19+00:00",
      "url_path": "/leads/3f2b7c1e-8a4d-4e6b-9c2f-1a7d5e9b0c43"
    },
    "customer": {
      "id": "6c1e9a24-5b7f-4d3a-8e2c-0f4b9d7a1e58",
      "name": "Sara Al Mansoori",
      "phone": "+971501234567",
      "email": null,
      "language": "ar"
    },
    "conversation": {
      "id": "b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17",
      "channel": "whatsapp",
      "status": "open",
      "assigned_agent": {
        "id": "9a7d3c15-2e8b-4f6a-b1d4-7c0e5a8f3b26",
        "name": "Omar Haddad"
      },
      "url_path": "/inbox/b4e8f2a6-1c3d-4b7e-9a5f-2d8c6e0b4a17"
    },
    "workflow": {
      "id": "2b4d6f8a-1c3e-4a5b-8d7f-9e1a3c5b7d92",
      "name": "Hot lead to CRM",
      "step_id": "s3",
      "run_id": "6f8a1c3e-5b7d-4e9a-a2c4-6e8b0d2f4a13"
    },
    "trigger": {
      "event": "lead.status_changed",
      "occurred_at": "2026-11-25T08:41:19+00:00"
    }
  }
}

Changelog

1.2.0 2026-11-27

  • New webhook event call.completed: a phone call ended, with its summary, outcome, length, who handled it and links to the lead and the chat. Zapier and Make have it as "Phone Call Ended".

1.1.0 2026-11-27

  • REST hooks for no-code platforms: POST /webhook-endpoints/subscriptions and DELETE /webhook-endpoints/subscriptions/{id}, used by the LeadVex apps for Zapier and Make.
  • GET /webhook-endpoints/events/{event}/sample: real or example payloads for a test step.
  • New webhook event conversation.closed. Endpoints list their source (app, zapier or make).

1.0.0 2026-11-25

  • First public release: token check, leads, customers, conversations and messages, test drives, inventory and webhook endpoints.
  • Idempotency-Key on every POST made with an API token.
  • 300 requests per minute per API token.