Create Lead Report
curl --request POST \
--url https://api.carviz.com/prod/public/reports/create-lead \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"dealership": "<string>",
"email": "",
"phone": "",
"name": "",
"folder_name": "",
"lang": "fr",
"custom_sms": "<string>",
"sendEmail": false,
"sendPhone": false
}
'import requests
url = "https://api.carviz.com/prod/public/reports/create-lead"
payload = {
"dealership": "<string>",
"email": "",
"phone": "",
"name": "",
"folder_name": "",
"lang": "fr",
"custom_sms": "<string>",
"sendEmail": False,
"sendPhone": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dealership: '<string>',
email: '',
phone: '',
name: '',
folder_name: '',
lang: 'fr',
custom_sms: '<string>',
sendEmail: false,
sendPhone: false
})
};
fetch('https://api.carviz.com/prod/public/reports/create-lead', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.carviz.com/prod/public/reports/create-lead",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dealership' => '<string>',
'email' => '',
'phone' => '',
'name' => '',
'folder_name' => '',
'lang' => 'fr',
'custom_sms' => '<string>',
'sendEmail' => false,
'sendPhone' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.carviz.com/prod/public/reports/create-lead"
payload := strings.NewReader("{\n \"dealership\": \"<string>\",\n \"email\": \"\",\n \"phone\": \"\",\n \"name\": \"\",\n \"folder_name\": \"\",\n \"lang\": \"fr\",\n \"custom_sms\": \"<string>\",\n \"sendEmail\": false,\n \"sendPhone\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.carviz.com/prod/public/reports/create-lead")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dealership\": \"<string>\",\n \"email\": \"\",\n \"phone\": \"\",\n \"name\": \"\",\n \"folder_name\": \"\",\n \"lang\": \"fr\",\n \"custom_sms\": \"<string>\",\n \"sendEmail\": false,\n \"sendPhone\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.carviz.com/prod/public/reports/create-lead")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dealership\": \"<string>\",\n \"email\": \"\",\n \"phone\": \"\",\n \"name\": \"\",\n \"folder_name\": \"\",\n \"lang\": \"fr\",\n \"custom_sms\": \"<string>\",\n \"sendEmail\": false,\n \"sendPhone\": false\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"link": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Reports
Create Lead Report
Create a “lead” remote report submitted by the client (no user/creator).
Authenticated via the organization’s x-api-key. The report is created with
type=remote and creator=NULL, counted against the entity’s subscription
quota like a normal remote report. Returns the report token and its app
link.
Body fields:
- dealership (required): id of the dealership the lead is attached to. Must belong to the API key’s organization. Resolves the organization, entity, subscription quota and report visibility.
- email (optional): client email, stored on the report and used for the email notification.
- phone (optional): client phone, stored on the report and used for the SMS notification.
- name (optional): client name, shown in the notifications.
- folder_name (optional): report folder alias.
- lang (optional, default “fr”): language of the notifications.
- custom_sms (optional): custom SMS body template (, placeholders supported).
- sendEmail (optional, default false): send the report link by email
(requires
email). - sendPhone (optional, default false): send the report link by SMS
(requires
phone).
POST
/
public
/
reports
/
create-lead
Create Lead Report
curl --request POST \
--url https://api.carviz.com/prod/public/reports/create-lead \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"dealership": "<string>",
"email": "",
"phone": "",
"name": "",
"folder_name": "",
"lang": "fr",
"custom_sms": "<string>",
"sendEmail": false,
"sendPhone": false
}
'import requests
url = "https://api.carviz.com/prod/public/reports/create-lead"
payload = {
"dealership": "<string>",
"email": "",
"phone": "",
"name": "",
"folder_name": "",
"lang": "fr",
"custom_sms": "<string>",
"sendEmail": False,
"sendPhone": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dealership: '<string>',
email: '',
phone: '',
name: '',
folder_name: '',
lang: 'fr',
custom_sms: '<string>',
sendEmail: false,
sendPhone: false
})
};
fetch('https://api.carviz.com/prod/public/reports/create-lead', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.carviz.com/prod/public/reports/create-lead",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dealership' => '<string>',
'email' => '',
'phone' => '',
'name' => '',
'folder_name' => '',
'lang' => 'fr',
'custom_sms' => '<string>',
'sendEmail' => false,
'sendPhone' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.carviz.com/prod/public/reports/create-lead"
payload := strings.NewReader("{\n \"dealership\": \"<string>\",\n \"email\": \"\",\n \"phone\": \"\",\n \"name\": \"\",\n \"folder_name\": \"\",\n \"lang\": \"fr\",\n \"custom_sms\": \"<string>\",\n \"sendEmail\": false,\n \"sendPhone\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.carviz.com/prod/public/reports/create-lead")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dealership\": \"<string>\",\n \"email\": \"\",\n \"phone\": \"\",\n \"name\": \"\",\n \"folder_name\": \"\",\n \"lang\": \"fr\",\n \"custom_sms\": \"<string>\",\n \"sendEmail\": false,\n \"sendPhone\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.carviz.com/prod/public/reports/create-lead")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dealership\": \"<string>\",\n \"email\": \"\",\n \"phone\": \"\",\n \"name\": \"\",\n \"folder_name\": \"\",\n \"lang\": \"fr\",\n \"custom_sms\": \"<string>\",\n \"sendEmail\": false,\n \"sendPhone\": false\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"link": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json