Settings
Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.
2 endpoints.
GET /settings
Get settings.
Auth apikey
:::note Used by the web app
pages/ChatbotManager.jsx, pages/CompanySettings.jsx, pages/NotificationSettings.jsx and 2 more
:::
cURL
curl -X GET 'https://api.leadx.in/api/key/protected/settings' \
-H 'apikey: $LEADX_API_KEY'
fetch
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/settings', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
},
});
const payload = await res.json();
if (!res.ok) {
// Errors carry { status, success, message } — not the success envelope.
throw new Error(`${res.status} ${payload.message}`);
}
console.log(payload.data);
axios
import axios from 'axios';
const leadx = axios.create({
baseURL: 'https://api.leadx.in/api/key/protected',
headers: { apikey: process.env.LEADX_API_KEY },
});
try {
const { data } = await leadx.get(
'/settings'
);
console.log(data.data);
} catch (err) {
// axios throws on 4xx/5xx; the envelope is on err.response.data.
throw new Error(`${err.response?.status} ${err.response?.data?.message ?? err.message}`);
}
Node (no deps)
import { request } from 'node:https';
// The dependency-free version, for somewhere fetch is not available.
const send = (payload) =>
new Promise((resolve, reject) => {
const req = request(
'https://api.leadx.in/api/key/protected/settings',
{
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
},
},
(res) => {
let raw = '';
res.on('data', (chunk) => { raw += chunk; });
res.on('end', () => {
const body = JSON.parse(raw);
if (res.statusCode >= 400) reject(new Error(`${res.statusCode} ${body.message}`));
else resolve(body);
});
},
);
req.on('error', reject);
req.end();
});
const { data } = await send(null);
console.log(data);
Python
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/settings",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
PHP
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/settings');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$payload = json_decode($response, true);
if ($status >= 400) {
throw new RuntimeException("$status {$payload['message']}");
}
print_r($payload['data']);
Errors SettingsNotFound_400
PUT /settings
Update settings.
Auth apikey · Success 200
:::note Used by the web app
pages/ChatbotManager.jsx, pages/CompanySettings.jsx, pages/NotificationSettings.jsx and 2 more
:::
Request body
| Field | Default |
|---|---|
currency | — |
dateFormat | — |
timeFormat | — |
timezone | — |
appName | — |
appDescription | — |
appVersion | — |
threads | — |
reddit | — |
quora | — |
discord | — |
medium | — |
pinterest | — |
facebook | — |
linkedin | — |
instagram | — |
youtube | — |
x | — |
notificationSettings | — |
mobileBackground | — |
teamSettings | — |
subscriptionPolicies | — |
manualChatbot | — |
cURL
curl -X PUT 'https://api.leadx.in/api/key/protected/settings' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"currency": "",
"dateFormat": "",
"timeFormat": "",
"timezone": "",
"appName": "",
"appDescription": "",
"appVersion": "",
"threads": "",
"reddit": "",
"quora": "",
"discord": "",
"medium": "",
"pinterest": "",
"facebook": "",
"linkedin": "",
"instagram": "",
"youtube": "",
"x": "",
"notificationSettings": "",
"mobileBackground": "",
"teamSettings": "",
"subscriptionPolicies": "",
"manualChatbot": ""
}'
fetch
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/settings', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"currency": "",
"dateFormat": "",
"timeFormat": "",
"timezone": "",
"appName": "",
"appDescription": "",
"appVersion": "",
"threads": "",
"reddit": "",
"quora": "",
"discord": "",
"medium": "",
"pinterest": "",
"facebook": "",
"linkedin": "",
"instagram": "",
"youtube": "",
"x": "",
"notificationSettings": "",
"mobileBackground": "",
"teamSettings": "",
"subscriptionPolicies": "",
"manualChatbot": ""
}),
});
const payload = await res.json();
if (!res.ok) {
// Errors carry { status, success, message } — not the success envelope.
throw new Error(`${res.status} ${payload.message}`);
}
console.log(payload.data);
axios
import axios from 'axios';
const leadx = axios.create({
baseURL: 'https://api.leadx.in/api/key/protected',
headers: { apikey: process.env.LEADX_API_KEY },
});
try {
const { data } = await leadx.put(
'/settings',
{
"currency": "",
"dateFormat": "",
"timeFormat": "",
"timezone": "",
"appName": "",
"appDescription": "",
"appVersion": "",
"threads": "",
"reddit": "",
"quora": "",
"discord": "",
"medium": "",
"pinterest": "",
"facebook": "",
"linkedin": "",
"instagram": "",
"youtube": "",
"x": "",
"notificationSettings": "",
"mobileBackground": "",
"teamSettings": "",
"subscriptionPolicies": "",
"manualChatbot": ""
}
);
console.log(data.data);
} catch (err) {
// axios throws on 4xx/5xx; the envelope is on err.response.data.
throw new Error(`${err.response?.status} ${err.response?.data?.message ?? err.message}`);
}
Node (no deps)
import { request } from 'node:https';
// The dependency-free version, for somewhere fetch is not available.
const send = (payload) =>
new Promise((resolve, reject) => {
const req = request(
'https://api.leadx.in/api/key/protected/settings',
{
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
},
(res) => {
let raw = '';
res.on('data', (chunk) => { raw += chunk; });
res.on('end', () => {
const body = JSON.parse(raw);
if (res.statusCode >= 400) reject(new Error(`${res.statusCode} ${body.message}`));
else resolve(body);
});
},
);
req.on('error', reject);
req.write(JSON.stringify(payload));
req.end();
});
const { data } = await send({
"currency": "",
"dateFormat": "",
"timeFormat": "",
"timezone": "",
"appName": "",
"appDescription": "",
"appVersion": "",
"threads": "",
"reddit": "",
"quora": "",
"discord": "",
"medium": "",
"pinterest": "",
"facebook": "",
"linkedin": "",
"instagram": "",
"youtube": "",
"x": "",
"notificationSettings": "",
"mobileBackground": "",
"teamSettings": "",
"subscriptionPolicies": "",
"manualChatbot": ""
});
console.log(data);
Python
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/settings",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"currency": "",
"dateFormat": "",
"timeFormat": "",
"timezone": "",
"appName": "",
"appDescription": "",
"appVersion": "",
"threads": "",
"reddit": "",
"quora": "",
"discord": "",
"medium": "",
"pinterest": "",
"facebook": "",
"linkedin": "",
"instagram": "",
"youtube": "",
"x": "",
"notificationSettings": "",
"mobileBackground": "",
"teamSettings": "",
"subscriptionPolicies": "",
"manualChatbot": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
PHP
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/settings');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'currency': '',
'dateFormat': '',
'timeFormat': '',
'timezone': '',
'appName': '',
'appDescription': '',
'appVersion': '',
'threads': '',
'reddit': '',
'quora': '',
'discord': '',
'medium': '',
'pinterest': '',
'facebook': '',
'linkedin': '',
'instagram': '',
'youtube': '',
'x': '',
'notificationSettings': '',
'mobileBackground': '',
'teamSettings': '',
'subscriptionPolicies': '',
'manualChatbot': ''
}),
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$payload = json_decode($response, true);
if ($status >= 400) {
throw new RuntimeException("$status {$payload['message']}");
}
print_r($payload['data']);
Errors InvalidEmailTemplate_400 · InvalidWhatsAppTemplate_400 · SettingsNotFound_400