Connected apps
Most providers follow one five-endpoint shape — list, create, bulk delete, read, update. See the Integrations guide.
Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.
145 endpoints.
GET /apps
Get app details.
Auth apikey
:::note Used by the web app
components/ContentMessaging.jsx, components/EmailProvider.jsx, components/ScheduleDelivery.jsx and 26 more
:::
Response — data is one App object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps', {
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);
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(
'/apps'
);
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}`);
}
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/apps',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps');
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 AppNotFound_400
PUT /apps
Update app details.
Auth apikey · Success 200
:::note Used by the web app
components/ContentMessaging.jsx, components/EmailProvider.jsx, components/ScheduleDelivery.jsx and 26 more
:::
Request body
| Field | Type | Default |
|---|---|---|
defaultSMTPServer | object | — |
defaultS3Bucket | — | |
uniqueKey | string | — |
companyType | string | — |
defaultCompanyType | string | — |
defaultOcr | — | |
defaultGemini | — | |
defaultClaude | — | |
defaultOffline | — | |
defaultZoom | — | |
defaultGoogleCalendar | — |
Response — data is one App object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"defaultSMTPServer": "",
"defaultS3Bucket": "",
"uniqueKey": "",
"companyType": "",
"defaultCompanyType": "",
"defaultOcr": "",
"defaultGemini": "",
"defaultClaude": "",
"defaultOffline": "",
"defaultZoom": "",
"defaultGoogleCalendar": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"defaultSMTPServer": "",
"defaultS3Bucket": "",
"uniqueKey": "",
"companyType": "",
"defaultCompanyType": "",
"defaultOcr": "",
"defaultGemini": "",
"defaultClaude": "",
"defaultOffline": "",
"defaultZoom": "",
"defaultGoogleCalendar": ""
}),
});
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);
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(
'/apps',
{
"defaultSMTPServer": "",
"defaultS3Bucket": "",
"uniqueKey": "",
"companyType": "",
"defaultCompanyType": "",
"defaultOcr": "",
"defaultGemini": "",
"defaultClaude": "",
"defaultOffline": "",
"defaultZoom": "",
"defaultGoogleCalendar": ""
}
);
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}`);
}
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/apps',
{
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({
"defaultSMTPServer": "",
"defaultS3Bucket": "",
"uniqueKey": "",
"companyType": "",
"defaultCompanyType": "",
"defaultOcr": "",
"defaultGemini": "",
"defaultClaude": "",
"defaultOffline": "",
"defaultZoom": "",
"defaultGoogleCalendar": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"defaultSMTPServer": "",
"defaultS3Bucket": "",
"uniqueKey": "",
"companyType": "",
"defaultCompanyType": "",
"defaultOcr": "",
"defaultGemini": "",
"defaultClaude": "",
"defaultOffline": "",
"defaultZoom": "",
"defaultGoogleCalendar": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps');
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({
'defaultSMTPServer': '',
'defaultS3Bucket': '',
'uniqueKey': '',
'companyType': '',
'defaultCompanyType': '',
'defaultOcr': '',
'defaultGemini': '',
'defaultClaude': '',
'defaultOffline': '',
'defaultZoom': '',
'defaultGoogleCalendar': ''
}),
]);
$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']);
GET /apps/brevo
Get all Brevo.
Auth apikey
:::note Used by the web app
pages/AddBrevo.jsx, pages/Brevo.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Brevo objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/brevo?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/brevo?p=1&n=25', {
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);
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(
'/apps/brevo?p=1&n=25'
);
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}`);
}
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/apps/brevo?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/brevo?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/brevo?p=1&n=25');
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']);
POST /apps/brevo
Create Brevo.
Auth apikey · Success 201
:::note Used by the web app
pages/AddBrevo.jsx, pages/Brevo.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
apiKey | string | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Brevo object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/brevo' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/brevo', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/brevo',
{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/brevo',
{
method: 'POST',
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({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/brevo",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/brevo');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'apiKey': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/brevo
Delete Brevo.
Auth apikey · Success 200
:::note Used by the web app
pages/AddBrevo.jsx, pages/Brevo.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/brevo' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/brevo', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/brevo',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/brevo',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/brevo",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/brevo');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoBrevoSelected_400
GET /apps/brevo/:id
Get Brevo.
Auth apikey
:::note Used by the web app
pages/AddBrevo.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Brevo object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID', {
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);
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(
'/apps/brevo/APPS_ID'
);
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}`);
}
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/apps/brevo/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID');
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 BrevoNotFound_404
PUT /apps/brevo/:id
Update Brevo.
Auth apikey · Success 200
:::note Used by the web app
pages/AddBrevo.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Brevo object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/brevo/APPS_ID'
);
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}`);
}
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/apps/brevo/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/brevo/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 BrevoNotFound_404
GET /apps/claude
Get Claude configurations.
Auth apikey
:::note Used by the web app
pages/AddClaude.jsx, pages/Claude.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Claude objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/claude?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/claude?p=1&n=25', {
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);
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(
'/apps/claude?p=1&n=25'
);
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}`);
}
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/apps/claude?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/claude?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/claude?p=1&n=25');
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']);
POST /apps/claude
Create Claude configuration.
Auth apikey
:::note Used by the web app
pages/AddClaude.jsx, pages/Claude.jsx
:::
Request body
| Field | Type | Required | Default |
|---|---|---|---|
name | string | yes | — |
apiKey | string | yes | — |
selectedModel | string | yes | — |
modelSettings | — | ||
isActive | boolean | — |
Response — data is one Claude object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/claude' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/claude', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}),
});
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);
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.post(
'/apps/claude',
{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}
);
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}`);
}
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/apps/claude',
{
method: 'POST',
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({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/claude",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/claude');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'apiKey': '',
'selectedModel': '',
'modelSettings': '',
'isActive': ''
}),
]);
$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 ClaudeNotAvailableInPlan_400 · InvalidClaudeConfiguration_400
DELETE /apps/claude
Delete Claude configuration.
Auth apikey · Success 200
:::note Used by the web app
pages/AddClaude.jsx, pages/Claude.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/claude' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/claude', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/claude',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/claude',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/claude",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/claude');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/claude/:id
Get Claude configuration.
Auth apikey
:::note Used by the web app
pages/AddClaude.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Claude object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/claude/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/claude/APPS_ID', {
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);
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(
'/apps/claude/APPS_ID'
);
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}`);
}
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/apps/claude/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/claude/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/claude/APPS_ID');
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 ClaudeConfigurationNotFound_400 · ClaudeNotAvailableInPlan_400
PUT /apps/claude/:id
Update Claude configuration.
Auth apikey
:::note Used by the web app
pages/AddClaude.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
apiKey | string | — |
selectedModel | string | — |
modelSettings | — | |
isActive | boolean | — |
Response — data is one Claude object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/claude/APPS_ID' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/claude/APPS_ID', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}),
});
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);
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(
'/apps/claude/APPS_ID',
{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}
);
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}`);
}
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/apps/claude/APPS_ID',
{
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({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/claude/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/claude/APPS_ID');
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({
'name': '',
'apiKey': '',
'selectedModel': '',
'modelSettings': '',
'isActive': ''
}),
]);
$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 ClaudeConfigurationNotFound_400 · ClaudeNotAvailableInPlan_400
GET /apps/claude/models
Get available Claude models.
Auth apikey
curl -X GET 'https://api.leadx.in/api/key/protected/apps/claude/models' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/claude/models', {
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);
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(
'/apps/claude/models'
);
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}`);
}
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/apps/claude/models',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/claude/models",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/claude/models');
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 ClaudeNotAvailableInPlan_400
GET /apps/elasticemail
Get all ElasticEmail.
Auth apikey
:::note Used by the web app
pages/AddElasticemail.jsx, pages/Elasticemail.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Elasticemail objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/elasticemail?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/elasticemail?p=1&n=25', {
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);
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(
'/apps/elasticemail?p=1&n=25'
);
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}`);
}
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/apps/elasticemail?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/elasticemail?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/elasticemail?p=1&n=25');
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']);
POST /apps/elasticemail
Create ElasticEmail.
Auth apikey · Success 201
:::note Used by the web app
pages/AddElasticemail.jsx, pages/Elasticemail.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
apiKey | string | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Elasticemail object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/elasticemail' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/elasticemail', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/elasticemail',
{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/elasticemail',
{
method: 'POST',
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({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/elasticemail",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/elasticemail');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'apiKey': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/elasticemail
Delete ElasticEmail.
Auth apikey · Success 200
:::note Used by the web app
pages/AddElasticemail.jsx, pages/Elasticemail.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/elasticemail' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/elasticemail', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/elasticemail',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/elasticemail',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/elasticemail",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/elasticemail');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoElasticemailSelected_400
GET /apps/elasticemail/:id
Get ElasticEmail.
Auth apikey
:::note Used by the web app
pages/AddElasticemail.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Elasticemail object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID', {
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);
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(
'/apps/elasticemail/APPS_ID'
);
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}`);
}
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/apps/elasticemail/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID');
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 ElasticemailNotFound_404
PUT /apps/elasticemail/:id
Update ElasticEmail.
Auth apikey · Success 200
:::note Used by the web app
pages/AddElasticemail.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Elasticemail object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/elasticemail/APPS_ID'
);
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}`);
}
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/apps/elasticemail/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/elasticemail/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 ElasticemailNotFound_404
POST /apps/facebook/apps
Create Facebook app.
Auth apikey
:::note Used by the web app
pages/AddFacebook.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
appID | string | — |
secret | string | — |
type | — |
Response — data is one FacebookApp object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/facebook/apps' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"appID": "",
"secret": "",
"type": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/apps', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"appID": "",
"secret": "",
"type": ""
}),
});
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);
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.post(
'/apps/facebook/apps',
{
"appID": "",
"secret": "",
"type": ""
}
);
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}`);
}
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/apps/facebook/apps',
{
method: 'POST',
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({
"appID": "",
"secret": "",
"type": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/facebook/apps",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"appID": "",
"secret": "",
"type": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/apps');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'appID': '',
'secret': '',
'type': ''
}),
]);
$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 FacebookAppIDRequired_400 · FacebookSecretRequired_400
GET /apps/facebook/apps/:id
Get Facebook app by ID.
Auth apikey
:::note Used by the web app
pages/AddFacebook.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one FacebookApp object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID', {
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);
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(
'/apps/facebook/apps/APPS_ID'
);
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}`);
}
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/apps/facebook/apps/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID');
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']);
PUT /apps/facebook/apps/:id
Update Facebook app.
Auth apikey
:::note Used by the web app
pages/AddFacebook.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Type | Default |
|---|---|---|
appID | string | — |
secret | string | — |
type | — |
Response — data is one FacebookApp object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"appID": "",
"secret": "",
"type": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"appID": "",
"secret": "",
"type": ""
}),
});
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);
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(
'/apps/facebook/apps/APPS_ID',
{
"appID": "",
"secret": "",
"type": ""
}
);
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}`);
}
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/apps/facebook/apps/APPS_ID',
{
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({
"appID": "",
"secret": "",
"type": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"appID": "",
"secret": "",
"type": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/apps/APPS_ID');
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({
'appID': '',
'secret': '',
'type': ''
}),
]);
$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']);
GET /apps/facebook/form/details
Get form details.
Auth apikey
Request body
| Field | Default |
|---|---|
formId | — |
accessToken | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/form/details' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"formId": "",
"accessToken": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/form/details', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"formId": "",
"accessToken": ""
}),
});
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);
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(
'/apps/facebook/form/details',
{
"formId": "",
"accessToken": ""
}
);
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}`);
}
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/apps/facebook/form/details',
{
method: 'GET',
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({
"formId": "",
"accessToken": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/form/details",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"formId": "",
"accessToken": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/form/details');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'formId': '',
'accessToken': ''
}),
]);
$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 FormIdOrTokenRequired_400
GET /apps/facebook/form/leads
Get form leads.
Auth apikey
Request body
| Field | Default |
|---|---|
formId | — |
accessToken | — |
limit | — |
after | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/form/leads' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"formId": "",
"accessToken": "",
"limit": "",
"after": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/form/leads', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"formId": "",
"accessToken": "",
"limit": "",
"after": ""
}),
});
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);
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(
'/apps/facebook/form/leads',
{
"formId": "",
"accessToken": "",
"limit": "",
"after": ""
}
);
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}`);
}
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/apps/facebook/form/leads',
{
method: 'GET',
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({
"formId": "",
"accessToken": "",
"limit": "",
"after": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/form/leads",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"formId": "",
"accessToken": "",
"limit": "",
"after": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/form/leads');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'formId': '',
'accessToken': '',
'limit': '',
'after': ''
}),
]);
$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 FormIdOrTokenRequired_400
PUT /apps/facebook/forms/:id
Update form.
Auth apikey
:::note Used by the web app
pages/AddFacebook.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Default |
|---|---|
isActive | — |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/facebook/forms/APPS_ID' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"isActive": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/forms/APPS_ID', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"isActive": ""
}),
});
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);
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(
'/apps/facebook/forms/APPS_ID',
{
"isActive": ""
}
);
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}`);
}
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/apps/facebook/forms/APPS_ID',
{
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({
"isActive": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/facebook/forms/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"isActive": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/forms/APPS_ID');
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({
'isActive': ''
}),
]);
$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']);
GET /apps/facebook/lead
Get specific lead.
Auth apikey
Request body
| Field | Default |
|---|---|
leadId | — |
accessToken | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/lead' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"leadId": "",
"accessToken": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/lead', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"leadId": "",
"accessToken": ""
}),
});
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);
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(
'/apps/facebook/lead',
{
"leadId": "",
"accessToken": ""
}
);
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}`);
}
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/apps/facebook/lead',
{
method: 'GET',
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({
"leadId": "",
"accessToken": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/lead",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"leadId": "",
"accessToken": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/lead');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'leadId': '',
'accessToken': ''
}),
]);
$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 LeadIdOrTokenRequired_400
PUT /apps/facebook/lead/status
Update lead status.
Auth apikey · Success 200
Request body
| Field | Default |
|---|---|
leadId | — |
accessToken | — |
status | — |
notes | — |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/facebook/lead/status' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"leadId": "",
"accessToken": "",
"status": "",
"notes": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/lead/status', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"leadId": "",
"accessToken": "",
"status": "",
"notes": ""
}),
});
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);
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(
'/apps/facebook/lead/status',
{
"leadId": "",
"accessToken": "",
"status": "",
"notes": ""
}
);
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}`);
}
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/apps/facebook/lead/status',
{
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({
"leadId": "",
"accessToken": "",
"status": "",
"notes": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/facebook/lead/status",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"leadId": "",
"accessToken": "",
"status": "",
"notes": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/lead/status');
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({
'leadId': '',
'accessToken': '',
'status': '',
'notes': ''
}),
]);
$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 LeadIdTokenStatusRequired_400
GET /apps/facebook/page/forms
Get page lead forms.
Auth apikey
Request body
| Field | Default |
|---|---|
pageId | — |
pageAccessToken | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/page/forms' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"pageId": "",
"pageAccessToken": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/page/forms', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"pageId": "",
"pageAccessToken": ""
}),
});
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);
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(
'/apps/facebook/page/forms',
{
"pageId": "",
"pageAccessToken": ""
}
);
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}`);
}
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/apps/facebook/page/forms',
{
method: 'GET',
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({
"pageId": "",
"pageAccessToken": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/page/forms",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"pageId": "",
"pageAccessToken": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/page/forms');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'pageId': '',
'pageAccessToken': ''
}),
]);
$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 PageIdOrTokenRequired_400
GET /apps/facebook/pages
Get user pages.
Auth apikey
:::note Used by the web app
pages/AddFacebook.jsx
:::
Response — data is one Page object. forms is populated, so it arrives as nested objects rather than ids.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/pages' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/pages', {
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);
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(
'/apps/facebook/pages'
);
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}`);
}
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/apps/facebook/pages',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/pages",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/pages');
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']);
GET /apps/facebook/sync/form-leads/:id
Sync form leads.
Auth apikey · Success 200
:::note Used by the web app
pages/AddFacebook.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/form-leads/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/form-leads/APPS_ID', {
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);
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(
'/apps/facebook/sync/form-leads/APPS_ID'
);
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}`);
}
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/apps/facebook/sync/form-leads/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/form-leads/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/form-leads/APPS_ID');
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 FacebookTokenRequired_400 · FormIdRequired_400
GET /apps/facebook/sync/job-status/:jobId
Get sync job status.
Auth apikey
Path parameters
| Name | |
|---|---|
jobId | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/job-status/JOBID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/job-status/JOBID', {
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);
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(
'/apps/facebook/sync/job-status/JOBID'
);
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}`);
}
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/apps/facebook/sync/job-status/JOBID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/job-status/JOBID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/job-status/JOBID');
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 JobIdRequired_400
GET /apps/facebook/sync/manual-job
Create manual sync job.
Auth apikey · Success 201
Request body
| Field | Default |
|---|---|
formId | — |
priority | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/manual-job' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"formId": "",
"priority": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/manual-job', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"formId": "",
"priority": ""
}),
});
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);
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(
'/apps/facebook/sync/manual-job',
{
"formId": "",
"priority": ""
}
);
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}`);
}
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/apps/facebook/sync/manual-job',
{
method: 'GET',
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({
"formId": "",
"priority": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/manual-job",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"formId": "",
"priority": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/manual-job');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'formId': '',
'priority': ''
}),
]);
$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']);
GET /apps/facebook/sync/page-forms-leads/:id
Sync page forms leads.
Auth apikey · Success 200
:::note Used by the web app
pages/AddFacebook.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one App object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms-leads/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms-leads/APPS_ID', {
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);
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(
'/apps/facebook/sync/page-forms-leads/APPS_ID'
);
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}`);
}
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/apps/facebook/sync/page-forms-leads/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms-leads/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms-leads/APPS_ID');
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 FacebookTokenRequired_400 · PageIdRequired_400
GET /apps/facebook/sync/page-forms/:id
Sync forms by page.
Auth apikey
:::note Used by the web app
pages/AddFacebook.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms/APPS_ID', {
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);
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(
'/apps/facebook/sync/page-forms/APPS_ID'
);
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}`);
}
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/apps/facebook/sync/page-forms/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/page-forms/APPS_ID');
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']);
GET /apps/facebook/sync/pages-forms
Sync forms by pages.
Auth apikey
:::note Used by the web app
pages/AddFacebook.jsx
:::
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms', {
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);
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(
'/apps/facebook/sync/pages-forms'
);
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}`);
}
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/apps/facebook/sync/pages-forms',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms');
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']);
GET /apps/facebook/sync/pages-forms-leads
Sync pages forms leads.
Auth apikey · Success 200
:::note Used by the web app
pages/AddFacebook.jsx
:::
Response — data is one App object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms-leads' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms-leads', {
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);
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(
'/apps/facebook/sync/pages-forms-leads'
);
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}`);
}
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/apps/facebook/sync/pages-forms-leads',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms-leads",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/pages-forms-leads');
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 FacebookTokenRequired_400
GET /apps/facebook/sync/process-job
Process sync job.
Auth apikey · Success 200
Request body
| Field | Default |
|---|---|
jobId | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/process-job' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jobId": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/process-job', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"jobId": ""
}),
});
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);
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(
'/apps/facebook/sync/process-job',
{
"jobId": ""
}
);
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}`);
}
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/apps/facebook/sync/process-job',
{
method: 'GET',
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({
"jobId": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/process-job",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"jobId": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/process-job');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'jobId': ''
}),
]);
$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 JobIdRequired_400
GET /apps/facebook/sync/schedule
Schedule periodic sync.
Auth apikey · Success 201
Request body
| Field | Default |
|---|---|
intervalHours | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/schedule' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"intervalHours": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/schedule', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"intervalHours": ""
}),
});
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);
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(
'/apps/facebook/sync/schedule',
{
"intervalHours": ""
}
);
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}`);
}
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/apps/facebook/sync/schedule',
{
method: 'GET',
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({
"intervalHours": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/schedule",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"intervalHours": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/schedule');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'intervalHours': ''
}),
]);
$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']);
GET /apps/facebook/sync/webhook-failures
Replay Facebook leads whose webhook delivery failed.
Auth apikey · Success 200
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-failures' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-failures', {
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);
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(
'/apps/facebook/sync/webhook-failures'
);
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}`);
}
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/apps/facebook/sync/webhook-failures',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-failures",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-failures');
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']);
GET /apps/facebook/sync/webhook-fallback-job
Create webhook fallback job.
Auth apikey · Success 201
Request body
| Field | Default |
|---|---|
formId | — |
leadId | — |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-fallback-job' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"formId": "",
"leadId": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-fallback-job', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"formId": "",
"leadId": ""
}),
});
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);
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(
'/apps/facebook/sync/webhook-fallback-job',
{
"formId": "",
"leadId": ""
}
);
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}`);
}
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/apps/facebook/sync/webhook-fallback-job',
{
method: 'GET',
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({
"formId": "",
"leadId": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-fallback-job",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"formId": "",
"leadId": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/sync/webhook-fallback-job');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'formId': '',
'leadId': ''
}),
]);
$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 FormIdRequired_400
POST /apps/facebook/validate-token
Validate Facebook token.
Auth apikey
Request body
| Field | Default |
|---|---|
accessToken | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/facebook/validate-token' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"accessToken": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/facebook/validate-token', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"accessToken": ""
}),
});
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);
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.post(
'/apps/facebook/validate-token',
{
"accessToken": ""
}
);
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}`);
}
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/apps/facebook/validate-token',
{
method: 'POST',
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({
"accessToken": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/facebook/validate-token",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"accessToken": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/facebook/validate-token');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'accessToken': ''
}),
]);
$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 FacebookTokenRequired_400
GET /apps/gemini
Get Gemini configurations.
Auth apikey
:::note Used by the web app
pages/AddGemini.jsx, pages/Gemini.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Gemini objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/gemini?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gemini?p=1&n=25', {
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);
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(
'/apps/gemini?p=1&n=25'
);
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}`);
}
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/apps/gemini?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/gemini?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gemini?p=1&n=25');
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']);
POST /apps/gemini
Create Gemini configuration.
Auth apikey
:::note Used by the web app
pages/AddGemini.jsx, pages/Gemini.jsx
:::
Request body
| Field | Type | Required | Default |
|---|---|---|---|
name | string | yes | — |
apiKey | string | yes | — |
selectedModel | string | yes | — |
modelSettings | — | ||
isActive | boolean | — |
Response — data is one Gemini object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/gemini' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gemini', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}),
});
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);
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.post(
'/apps/gemini',
{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}
);
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}`);
}
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/apps/gemini',
{
method: 'POST',
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({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/gemini",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gemini');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'apiKey': '',
'selectedModel': '',
'modelSettings': '',
'isActive': ''
}),
]);
$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 GeminiNotAvailableInPlan_400 · InvalidGeminiConfiguration_400
DELETE /apps/gemini
Delete Gemini configuration.
Auth apikey · Success 200
:::note Used by the web app
pages/AddGemini.jsx, pages/Gemini.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/gemini' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gemini', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/gemini',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/gemini',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/gemini",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gemini');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/gemini/:id
Get Gemini configuration.
Auth apikey
:::note Used by the web app
pages/AddGemini.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Gemini object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID', {
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);
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(
'/apps/gemini/APPS_ID'
);
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}`);
}
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/apps/gemini/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID');
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 GeminiConfigurationNotFound_400 · GeminiNotAvailableInPlan_400
PUT /apps/gemini/:id
Update Gemini configuration.
Auth apikey
:::note Used by the web app
pages/AddGemini.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
apiKey | string | — |
selectedModel | string | — |
modelSettings | — | |
isActive | boolean | — |
Response — data is one Gemini object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}),
});
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);
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(
'/apps/gemini/APPS_ID',
{
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
}
);
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}`);
}
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/apps/gemini/APPS_ID',
{
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({
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"selectedModel": "",
"modelSettings": "",
"isActive": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gemini/APPS_ID');
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({
'name': '',
'apiKey': '',
'selectedModel': '',
'modelSettings': '',
'isActive': ''
}),
]);
$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 GeminiConfigurationNotFound_400 · GeminiNotAvailableInPlan_400
GET /apps/gemini/models
Get available models.
Auth apikey
curl -X GET 'https://api.leadx.in/api/key/protected/apps/gemini/models' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gemini/models', {
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);
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(
'/apps/gemini/models'
);
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}`);
}
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/apps/gemini/models',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/gemini/models",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gemini/models');
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 GeminiNotAvailableInPlan_400
GET /apps/gmail
Get all Gmail.
Auth apikey
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Gmail objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/gmail?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gmail?p=1&n=25', {
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);
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(
'/apps/gmail?p=1&n=25'
);
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}`);
}
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/apps/gmail?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/gmail?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gmail?p=1&n=25');
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']);
POST /apps/gmail
Handle Gmail callback.
Auth apikey · Success 201
Request body
| Field | Default |
|---|---|
code | — |
Response — data is one Gmail object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/gmail' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"code": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gmail', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"code": ""
}),
});
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);
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.post(
'/apps/gmail',
{
"code": ""
}
);
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}`);
}
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/apps/gmail',
{
method: 'POST',
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({
"code": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/gmail",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"code": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gmail');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'code': ''
}),
]);
$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 GmailCodeRequired_400
DELETE /apps/gmail
Delete Gmail.
Auth apikey · Success 200
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/gmail' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gmail', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/gmail',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/gmail',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/gmail",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gmail');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/gmail/:id
Get Gmail.
Auth apikey
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Gmail object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID', {
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);
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(
'/apps/gmail/APPS_ID'
);
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}`);
}
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/apps/gmail/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID');
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 GmailNotFound_404
PUT /apps/gmail/:id
Update Gmail.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Gmail object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/gmail/APPS_ID'
);
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}`);
}
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/apps/gmail/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gmail/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 GmailNotFound_404
GET /apps/gmail/redirect
Get redirect URI.
Auth apikey
curl -X GET 'https://api.leadx.in/api/key/protected/apps/gmail/redirect' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gmail/redirect', {
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);
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(
'/apps/gmail/redirect'
);
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}`);
}
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/apps/gmail/redirect',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/gmail/redirect",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gmail/redirect');
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']);
GET /apps/gmail/refresh
Refresh Gmail.
Auth apikey
Request body
| Field | Default |
|---|---|
code | — |
Response — data is one Gmail object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/gmail/refresh' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"code": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/gmail/refresh', {
method: 'GET',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"code": ""
}),
});
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);
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(
'/apps/gmail/refresh',
{
"code": ""
}
);
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}`);
}
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/apps/gmail/refresh',
{
method: 'GET',
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({
"code": ""
});
console.log(data);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/gmail/refresh",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"code": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/gmail/refresh');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'code': ''
}),
]);
$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']);
GET /apps/google-calendar
Get Google calendar accounts.
Auth apikey
:::note Used by the web app
components/MemberGoogleCalendarAssignment.jsx, pages/GoogleCalendar.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of GoogleCalendarAccount objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/google-calendar?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/google-calendar?p=1&n=25', {
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);
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(
'/apps/google-calendar?p=1&n=25'
);
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}`);
}
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/apps/google-calendar?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/google-calendar?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/google-calendar?p=1&n=25');
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']);
POST /apps/google-calendar
Create Google calendar account.
Auth apikey · Success 200
:::note Used by the web app
components/MemberGoogleCalendarAssignment.jsx, pages/GoogleCalendar.jsx
:::
Request body
| Field | Type | Required | Default |
|---|---|---|---|
name | yes | — | |
authType | string | manual | |
clientId | yes | — | |
clientSecret | yes | — | |
refreshToken | yes | — | |
calendarId | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/google-calendar' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"authType": "manual",
"clientId": "",
"clientSecret": "",
"refreshToken": "",
"calendarId": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/google-calendar', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"authType": "manual",
"clientId": "",
"clientSecret": "",
"refreshToken": "",
"calendarId": ""
}),
});
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);
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.post(
'/apps/google-calendar',
{
"name": "",
"authType": "manual",
"clientId": "",
"clientSecret": "",
"refreshToken": "",
"calendarId": ""
}
);
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}`);
}
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/apps/google-calendar',
{
method: 'POST',
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({
"name": "",
"authType": "manual",
"clientId": "",
"clientSecret": "",
"refreshToken": "",
"calendarId": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/google-calendar",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"authType": "manual",
"clientId": "",
"clientSecret": "",
"refreshToken": "",
"calendarId": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/google-calendar');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'authType': 'manual',
'clientId': '',
'clientSecret': '',
'refreshToken': '',
'calendarId': ''
}),
]);
$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']);
DELETE /apps/google-calendar
Delete Google calendar accounts.
Auth apikey · Success 200
:::note Used by the web app
components/MemberGoogleCalendarAssignment.jsx, pages/GoogleCalendar.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/google-calendar' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/google-calendar', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/google-calendar',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/google-calendar',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/google-calendar",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/google-calendar');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/google-calendar/:id
Get Google calendar account.
Auth apikey
Path parameters
| Name | |
|---|---|
id | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID', {
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);
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(
'/apps/google-calendar/APPS_ID'
);
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}`);
}
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/apps/google-calendar/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID');
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']);
PUT /apps/google-calendar/:id
Update Google calendar account.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/google-calendar/APPS_ID'
);
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}`);
}
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/apps/google-calendar/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/google-calendar/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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']);
POST /apps/google-calendar/redirect
Get Google calendar redirect URI.
Auth apikey
curl -X POST 'https://api.leadx.in/api/key/protected/apps/google-calendar/redirect' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/google-calendar/redirect', {
method: 'POST',
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);
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.post(
'/apps/google-calendar/redirect'
);
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}`);
}
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/apps/google-calendar/redirect',
{
method: 'POST',
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);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/google-calendar/redirect",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/google-calendar/redirect');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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']);
GET /apps/instagram
Get all Instagram apps.
Auth apikey
:::note Used by the web app
pages/AddInstagram.jsx, pages/Instagram.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of InstagramApp objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/instagram?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram?p=1&n=25', {
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);
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(
'/apps/instagram?p=1&n=25'
);
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}`);
}
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/apps/instagram?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/instagram?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram?p=1&n=25');
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']);
POST /apps/instagram
Create Instagram app.
Auth apikey · Success 201
:::note Used by the web app
pages/AddInstagram.jsx, pages/Instagram.jsx
:::
Request body
| Field | Required | Default |
|---|---|---|
name | yes | — |
appId | yes | — |
appSecret | yes | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"appId": "",
"appSecret": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"appId": "",
"appSecret": ""
}),
});
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);
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.post(
'/apps/instagram',
{
"name": "",
"appId": "",
"appSecret": ""
}
);
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}`);
}
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/apps/instagram',
{
method: 'POST',
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({
"name": "",
"appId": "",
"appSecret": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"appId": "",
"appSecret": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'appId': '',
'appSecret': ''
}),
]);
$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']);
GET /apps/instagram/:id
Get Instagram app.
Auth apikey
:::note Used by the web app
pages/AddInstagram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID', {
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);
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(
'/apps/instagram/APPS_ID'
);
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}`);
}
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/apps/instagram/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID');
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 InstagramAppNotFound_404
PUT /apps/instagram/:id
Update Instagram app.
Auth apikey · Success 200
:::note Used by the web app
pages/AddInstagram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Default |
|---|---|
name | — |
appId | — |
appSecret | — |
accessToken | — |
pageId | — |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"appId": "",
"appSecret": "",
"accessToken": "",
"pageId": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"appId": "",
"appSecret": "",
"accessToken": "",
"pageId": ""
}),
});
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);
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(
'/apps/instagram/APPS_ID',
{
"name": "",
"appId": "",
"appSecret": "",
"accessToken": "",
"pageId": ""
}
);
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}`);
}
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/apps/instagram/APPS_ID',
{
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({
"name": "",
"appId": "",
"appSecret": "",
"accessToken": "",
"pageId": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"appId": "",
"appSecret": "",
"accessToken": "",
"pageId": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID');
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({
'name': '',
'appId': '',
'appSecret': '',
'accessToken': '',
'pageId': ''
}),
]);
$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 InstagramAppNotFound_404
GET /apps/instagram/:id/accounts
Get app Instagram accounts.
Auth apikey
:::note Used by the web app
pages/AddInstagram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts', {
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);
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(
'/apps/instagram/APPS_ID/accounts'
);
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}`);
}
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/apps/instagram/APPS_ID/accounts',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts');
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 InstagramAppNotFound_404
POST /apps/instagram/:id/accounts
Create Instagram account.
Auth apikey · Success 201
:::note Used by the web app
pages/AddInstagram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Required | Default |
|---|---|---|
instagramUserId | yes | — |
instagramUsername | — | |
name | — | |
pageId | — | |
pageName | — | |
accountType | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"instagramUserId": "",
"instagramUsername": "",
"name": "",
"pageId": "",
"pageName": "",
"accountType": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"instagramUserId": "",
"instagramUsername": "",
"name": "",
"pageId": "",
"pageName": "",
"accountType": ""
}),
});
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);
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.post(
'/apps/instagram/APPS_ID/accounts',
{
"instagramUserId": "",
"instagramUsername": "",
"name": "",
"pageId": "",
"pageName": "",
"accountType": ""
}
);
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}`);
}
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/apps/instagram/APPS_ID/accounts',
{
method: 'POST',
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({
"instagramUserId": "",
"instagramUsername": "",
"name": "",
"pageId": "",
"pageName": "",
"accountType": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"instagramUserId": "",
"instagramUsername": "",
"name": "",
"pageId": "",
"pageName": "",
"accountType": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'instagramUserId': '',
'instagramUsername': '',
'name': '',
'pageId': '',
'pageName': '',
'accountType': ''
}),
]);
$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']);
GET /apps/instagram/:id/accounts/:accountId
Get Instagram account.
Auth apikey
:::note Used by the web app
pages/AddInstagram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
accountId | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID', {
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);
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(
'/apps/instagram/APPS_ID/accounts/ACCOUNTID'
);
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}`);
}
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/apps/instagram/APPS_ID/accounts/ACCOUNTID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID');
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 InstagramAccountNotFound_404 · InstagramAppNotFound_404
PUT /apps/instagram/:id/accounts/:accountId
Update Instagram account.
Auth apikey · Success 200
:::note Used by the web app
pages/AddInstagram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
accountId | Required |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID', {
method: 'PUT',
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);
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(
'/apps/instagram/APPS_ID/accounts/ACCOUNTID'
);
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}`);
}
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/apps/instagram/APPS_ID/accounts/ACCOUNTID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 InstagramAppNotFound_404
DELETE /apps/instagram/:id/accounts/:accountId
Delete Instagram account.
Auth apikey · Success 200
:::note Used by the web app
pages/AddInstagram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
accountId | Required |
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID', {
method: 'DELETE',
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);
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.delete(
'/apps/instagram/APPS_ID/accounts/ACCOUNTID'
);
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}`);
}
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/apps/instagram/APPS_ID/accounts/ACCOUNTID',
{
method: 'DELETE',
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);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
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 InstagramAppNotFound_404
POST /apps/instagram/:id/accounts/:accountId/comment/like
Like Instagram comment by account.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
accountId | Required |
Request body
| Field | Required | Default |
|---|---|---|
commentId | yes | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/like' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"commentId": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/like', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"commentId": ""
}),
});
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);
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.post(
'/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/like',
{
"commentId": ""
}
);
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}`);
}
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/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/like',
{
method: 'POST',
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({
"commentId": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/like",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"commentId": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/like');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'commentId': ''
}),
]);
$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']);
POST /apps/instagram/:id/accounts/:accountId/comment/reply
Reply Instagram comment by account.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
accountId | Required |
Request body
| Field | Required | Default |
|---|---|---|
commentId | yes | — |
text | yes | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/reply' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"commentId": "",
"text": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/reply', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"commentId": "",
"text": ""
}),
});
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);
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.post(
'/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/reply',
{
"commentId": "",
"text": ""
}
);
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}`);
}
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/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/reply',
{
method: 'POST',
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({
"commentId": "",
"text": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/reply",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"commentId": "",
"text": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/comment/reply');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'commentId': '',
'text': ''
}),
]);
$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']);
POST /apps/instagram/:id/accounts/:accountId/reply
Reply Instagram DM by account.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
accountId | Required |
Request body
| Field | Required | Default |
|---|---|---|
messageId | yes | — |
text | yes | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/reply' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"messageId": "",
"text": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/reply', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"messageId": "",
"text": ""
}),
});
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);
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.post(
'/apps/instagram/APPS_ID/accounts/ACCOUNTID/reply',
{
"messageId": "",
"text": ""
}
);
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}`);
}
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/apps/instagram/APPS_ID/accounts/ACCOUNTID/reply',
{
method: 'POST',
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({
"messageId": "",
"text": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/reply",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"messageId": "",
"text": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/reply');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'messageId': '',
'text': ''
}),
]);
$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']);
POST /apps/instagram/:id/accounts/:accountId/send
Send Instagram DM by account.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
accountId | Required |
Request body
| Field | Required | Default |
|---|---|---|
recipientId | yes | — |
senderId | yes | — |
message | yes | — |
Response — data is one UnifiedMessage object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/send' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"recipientId": "",
"senderId": "",
"message": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/send', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"recipientId": "",
"senderId": "",
"message": ""
}),
});
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);
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.post(
'/apps/instagram/APPS_ID/accounts/ACCOUNTID/send',
{
"recipientId": "",
"senderId": "",
"message": ""
}
);
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}`);
}
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/apps/instagram/APPS_ID/accounts/ACCOUNTID/send',
{
method: 'POST',
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({
"recipientId": "",
"senderId": "",
"message": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/send",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"recipientId": "",
"senderId": "",
"message": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/accounts/ACCOUNTID/send');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'recipientId': '',
'senderId': '',
'message': ''
}),
]);
$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']);
POST /apps/instagram/:id/oauth/refresh
Refresh Instagram token.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/refresh' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/refresh', {
method: 'POST',
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);
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.post(
'/apps/instagram/APPS_ID/oauth/refresh'
);
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}`);
}
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/apps/instagram/APPS_ID/oauth/refresh',
{
method: 'POST',
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);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/refresh",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/refresh');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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 InstagramAppNotFound_404 · InvalidRequest_400
GET /apps/instagram/:id/oauth/status
Get Instagram OAuth status.
Auth apikey
Path parameters
| Name | |
|---|---|
id | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/status' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/status', {
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);
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(
'/apps/instagram/APPS_ID/oauth/status'
);
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}`);
}
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/apps/instagram/APPS_ID/oauth/status',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/status",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/oauth/status');
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 InstagramAppNotFound_404
POST /apps/instagram/:id/send-me
Auth apikey
Path parameters
| Name | |
|---|---|
id | Required |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/send-me' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/send-me', {
method: 'POST',
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);
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.post(
'/apps/instagram/APPS_ID/send-me'
);
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}`);
}
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/apps/instagram/APPS_ID/send-me',
{
method: 'POST',
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);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/send-me",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/send-me');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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']);
POST /apps/instagram/:id/webhook/subscribe
Subscribe Instagram webhook.
Auth apikey · Success 200
Path parameters
| Name | |
|---|---|
id | Required |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/webhook/subscribe' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/webhook/subscribe', {
method: 'POST',
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);
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.post(
'/apps/instagram/APPS_ID/webhook/subscribe'
);
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}`);
}
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/apps/instagram/APPS_ID/webhook/subscribe',
{
method: 'POST',
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);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/webhook/subscribe",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/APPS_ID/webhook/subscribe');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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 InstagramAppNotFound_404 · InvalidRequest_400 · WebhookSubscriptionFailed_500
POST /apps/instagram/oauth/callback
Handle Instagram OAuth callback.
Auth apikey
:::note Used by the web app
pages/AddInstagram.jsx
:::
Query parameters
| Field | Default |
|---|---|
code | — |
state | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/oauth/callback' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/oauth/callback', {
method: 'POST',
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);
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.post(
'/apps/instagram/oauth/callback'
);
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}`);
}
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/apps/instagram/oauth/callback',
{
method: 'POST',
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);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/oauth/callback",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/oauth/callback');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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 Unauthorized_401
POST /apps/instagram/oauth/init
Init Instagram OAuth.
Auth apikey · Success 200
:::note Used by the web app
pages/AddInstagram.jsx
:::
Request body
| Field | Default |
|---|---|
scopes | — |
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X POST 'https://api.leadx.in/api/key/protected/apps/instagram/oauth/init' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"scopes": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/instagram/oauth/init', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"scopes": ""
}),
});
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);
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.post(
'/apps/instagram/oauth/init',
{
"scopes": ""
}
);
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}`);
}
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/apps/instagram/oauth/init',
{
method: 'POST',
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({
"scopes": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/instagram/oauth/init",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"scopes": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/instagram/oauth/init');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'scopes': ''
}),
]);
$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']);
GET /apps/mailchimp
Get all Mailchimp.
Auth apikey
:::note Used by the web app
pages/AddMailchimp.jsx, pages/Mailchimp.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Mailchimp objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/mailchimp?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/mailchimp?p=1&n=25', {
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);
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(
'/apps/mailchimp?p=1&n=25'
);
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}`);
}
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/apps/mailchimp?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/mailchimp?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/mailchimp?p=1&n=25');
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']);
POST /apps/mailchimp
Create Mailchimp.
Auth apikey · Success 201
:::note Used by the web app
pages/AddMailchimp.jsx, pages/Mailchimp.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
apiKey | string | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Mailchimp object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/mailchimp' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/mailchimp', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/mailchimp',
{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/mailchimp',
{
method: 'POST',
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({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/mailchimp",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/mailchimp');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'apiKey': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/mailchimp
Delete Mailchimp.
Auth apikey · Success 200
:::note Used by the web app
pages/AddMailchimp.jsx, pages/Mailchimp.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/mailchimp' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/mailchimp', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/mailchimp',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/mailchimp',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/mailchimp",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/mailchimp');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoMailchimpSelected_400
GET /apps/mailchimp/:id
Get Mailchimp.
Auth apikey
:::note Used by the web app
pages/AddMailchimp.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Mailchimp object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID', {
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);
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(
'/apps/mailchimp/APPS_ID'
);
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}`);
}
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/apps/mailchimp/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID');
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 MailchimpNotFound_404
PUT /apps/mailchimp/:id
Update Mailchimp.
Auth apikey · Success 200
:::note Used by the web app
pages/AddMailchimp.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Mailchimp object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/mailchimp/APPS_ID'
);
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}`);
}
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/apps/mailchimp/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/mailchimp/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 MailchimpNotFound_404
POST /apps/oAuthWhatsApp/:id/complete-onboarding
Complete OAuth WhatsApp onboarding.
Auth apikey
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Required | Default |
|---|---|---|
code | yes | — |
sessionInfo | — | |
name | — | |
redirectUri | — | |
pin | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/oAuthWhatsApp/APPS_ID/complete-onboarding' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"code": "",
"sessionInfo": "",
"name": "",
"redirectUri": "",
"pin": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/oAuthWhatsApp/APPS_ID/complete-onboarding', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"code": "",
"sessionInfo": "",
"name": "",
"redirectUri": "",
"pin": ""
}),
});
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);
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.post(
'/apps/oAuthWhatsApp/APPS_ID/complete-onboarding',
{
"code": "",
"sessionInfo": "",
"name": "",
"redirectUri": "",
"pin": ""
}
);
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}`);
}
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/apps/oAuthWhatsApp/APPS_ID/complete-onboarding',
{
method: 'POST',
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({
"code": "",
"sessionInfo": "",
"name": "",
"redirectUri": "",
"pin": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/oAuthWhatsApp/APPS_ID/complete-onboarding",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"code": "",
"sessionInfo": "",
"name": "",
"redirectUri": "",
"pin": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/oAuthWhatsApp/APPS_ID/complete-onboarding');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'code': '',
'sessionInfo': '',
'name': '',
'redirectUri': '',
'pin': ''
}),
]);
$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']);
GET /apps/ocr
Get all ocr.
Auth apikey
:::note Used by the web app
pages/AddOcr.jsx, pages/OCR.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Ocr objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/ocr?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ocr?p=1&n=25', {
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);
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(
'/apps/ocr?p=1&n=25'
);
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}`);
}
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/apps/ocr?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/ocr?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ocr?p=1&n=25');
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']);
POST /apps/ocr
Create ocr.
Auth apikey · Success 200
:::note Used by the web app
pages/AddOcr.jsx, pages/OCR.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
key | string | — |
Response — data is one Ocr object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/ocr' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"key": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ocr', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"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);
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.post(
'/apps/ocr',
{
"name": "",
"key": ""
}
);
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}`);
}
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/apps/ocr',
{
method: 'POST',
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({
"name": "",
"key": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/ocr",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"key": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ocr');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'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 OcrNotFound_404
DELETE /apps/ocr
Delete ocr.
Auth apikey · Success 200
:::note Used by the web app
pages/AddOcr.jsx, pages/OCR.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/ocr' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ocr', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/ocr',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/ocr',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/ocr",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ocr');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/ocr/:id
Get ocr.
Auth apikey
:::note Used by the web app
components/CustomFieldsBasedForm.jsx, pages/AddOcr.jsx, pages/ScanAndCreate.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Ocr object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID', {
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);
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(
'/apps/ocr/APPS_ID'
);
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}`);
}
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/apps/ocr/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID');
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 OcrNotFound_404
PUT /apps/ocr/:id
Update ocr.
Auth apikey · Success 200
:::note Used by the web app
components/CustomFieldsBasedForm.jsx, pages/AddOcr.jsx, pages/ScanAndCreate.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Ocr object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/ocr/APPS_ID'
);
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}`);
}
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/apps/ocr/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ocr/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 OcrNotFound_404
POST /apps/ocr/image
Do OCR and parse.
Auth apikey · Success 200
Request body
| Field | Default |
|---|---|
fileIDs | — |
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X POST 'https://api.leadx.in/api/key/protected/apps/ocr/image' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"fileIDs": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ocr/image', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"fileIDs": ""
}),
});
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);
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.post(
'/apps/ocr/image',
{
"fileIDs": ""
}
);
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}`);
}
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/apps/ocr/image',
{
method: 'POST',
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({
"fileIDs": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/ocr/image",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"fileIDs": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ocr/image');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'fileIDs': ''
}),
]);
$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 OcrNotFound_404
GET /apps/offline-meeting
Get all offline venues.
Auth apikey
:::note Used by the web app
components/ScheduleMeetingModal.jsx, pages/AddMeeting.jsx, pages/AddOfflineMeeting.jsx and 1 more
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of OfflineLocation objects, alongside the pagination fields described in Response format. createdBy is populated, so it arrives as nested objects rather than ids.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/offline-meeting?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/offline-meeting?p=1&n=25', {
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);
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(
'/apps/offline-meeting?p=1&n=25'
);
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}`);
}
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/apps/offline-meeting?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/offline-meeting?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/offline-meeting?p=1&n=25');
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']);
POST /apps/offline-meeting
Create offline venue.
Auth apikey · Success 200
:::note Used by the web app
components/ScheduleMeetingModal.jsx, pages/AddMeeting.jsx, pages/AddOfflineMeeting.jsx and 1 more
:::
Request body
| Field | Type | Required | Default |
|---|---|---|---|
name | string | yes | — |
address | string | — | |
mapLink | string | — | |
notes | string | — |
Response — data is one OfflineLocation object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/offline-meeting' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"address": "",
"mapLink": "",
"notes": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/offline-meeting', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"address": "",
"mapLink": "",
"notes": ""
}),
});
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);
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.post(
'/apps/offline-meeting',
{
"name": "",
"address": "",
"mapLink": "",
"notes": ""
}
);
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}`);
}
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/apps/offline-meeting',
{
method: 'POST',
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({
"name": "",
"address": "",
"mapLink": "",
"notes": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/offline-meeting",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"address": "",
"mapLink": "",
"notes": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/offline-meeting');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'address': '',
'mapLink': '',
'notes': ''
}),
]);
$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']);
DELETE /apps/offline-meeting
Delete offline venues.
Auth apikey · Success 200
:::note Used by the web app
components/ScheduleMeetingModal.jsx, pages/AddMeeting.jsx, pages/AddOfflineMeeting.jsx and 1 more
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/offline-meeting' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/offline-meeting', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/offline-meeting',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/offline-meeting',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/offline-meeting",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/offline-meeting');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/offline-meeting/:id
Get offline venue.
Auth apikey
:::note Used by the web app
pages/AddOfflineMeeting.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one OfflineLocation object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID', {
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);
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(
'/apps/offline-meeting/APPS_ID'
);
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}`);
}
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/apps/offline-meeting/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID');
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']);
PUT /apps/offline-meeting/:id
Update offline venue.
Auth apikey · Success 200
:::note Used by the web app
pages/AddOfflineMeeting.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one OfflineLocation object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/offline-meeting/APPS_ID'
);
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}`);
}
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/apps/offline-meeting/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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']);
DELETE /apps/offline-meeting/:id
Delete offline venue.
Auth apikey · Success 200
:::note Used by the web app
pages/AddOfflineMeeting.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID', {
method: 'DELETE',
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);
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.delete(
'/apps/offline-meeting/APPS_ID'
);
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}`);
}
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/apps/offline-meeting/APPS_ID',
{
method: 'DELETE',
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);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/offline-meeting/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
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']);
GET /apps/postmark
Get all Postmark.
Auth apikey
:::note Used by the web app
pages/AddPostmark.jsx, pages/Postmark.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Postmark objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/postmark?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/postmark?p=1&n=25', {
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);
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(
'/apps/postmark?p=1&n=25'
);
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}`);
}
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/apps/postmark?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/postmark?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/postmark?p=1&n=25');
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']);
POST /apps/postmark
Create Postmark.
Auth apikey · Success 201
:::note Used by the web app
pages/AddPostmark.jsx, pages/Postmark.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
serverToken | string | — |
messageStream | string | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Postmark object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/postmark' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"serverToken": "",
"messageStream": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/postmark', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"serverToken": "",
"messageStream": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/postmark',
{
"name": "",
"serverToken": "",
"messageStream": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/postmark',
{
method: 'POST',
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({
"name": "",
"serverToken": "",
"messageStream": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/postmark",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"serverToken": "",
"messageStream": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/postmark');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'serverToken': '',
'messageStream': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/postmark
Delete Postmark.
Auth apikey · Success 200
:::note Used by the web app
pages/AddPostmark.jsx, pages/Postmark.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/postmark' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/postmark', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/postmark',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/postmark',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/postmark",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/postmark');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoPostmarkSelected_400
GET /apps/postmark/:id
Get Postmark.
Auth apikey
:::note Used by the web app
pages/AddPostmark.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Postmark object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID', {
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);
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(
'/apps/postmark/APPS_ID'
);
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}`);
}
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/apps/postmark/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID');
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 PostmarkNotFound_404
PUT /apps/postmark/:id
Update Postmark.
Auth apikey · Success 200
:::note Used by the web app
pages/AddPostmark.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Postmark object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/postmark/APPS_ID'
);
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}`);
}
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/apps/postmark/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/postmark/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 PostmarkNotFound_404
GET /apps/s3bucket
Get all S3 bucket.
Auth apikey
:::note Used by the web app
pages/AWSS3Bucket.jsx, pages/AddS3Bucket.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Bucket objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/s3bucket?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/s3bucket?p=1&n=25', {
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);
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(
'/apps/s3bucket?p=1&n=25'
);
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}`);
}
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/apps/s3bucket?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/s3bucket?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/s3bucket?p=1&n=25');
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']);
POST /apps/s3bucket
Create S3 bucket.
Auth apikey · Success 201
:::note Used by the web app
pages/AWSS3Bucket.jsx, pages/AddS3Bucket.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
accesskey | string | — |
secretkey | string | — |
region | string | — |
name | string | — |
subpath | string | — |
Response — data is one Bucket object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/s3bucket' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"accesskey": "",
"secretkey": "",
"region": "",
"name": "",
"subpath": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/s3bucket', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"accesskey": "",
"secretkey": "",
"region": "",
"name": "",
"subpath": ""
}),
});
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);
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.post(
'/apps/s3bucket',
{
"accesskey": "",
"secretkey": "",
"region": "",
"name": "",
"subpath": ""
}
);
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}`);
}
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/apps/s3bucket',
{
method: 'POST',
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({
"accesskey": "",
"secretkey": "",
"region": "",
"name": "",
"subpath": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/s3bucket",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"accesskey": "",
"secretkey": "",
"region": "",
"name": "",
"subpath": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/s3bucket');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'accesskey': '',
'secretkey': '',
'region': '',
'name': '',
'subpath': ''
}),
]);
$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']);
PUT /apps/s3bucket
Bulk update S3 bucket.
Auth apikey · Success 200
:::note Used by the web app
pages/AWSS3Bucket.jsx, pages/AddS3Bucket.jsx
:::
Request body
| Field | Type | Default | Notes |
|---|---|---|---|
updateType | — | replace (default), or append for array-valued custom fields. | |
formData | object | {} | System and custom fields together — see Custom fields. |
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/s3bucket' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"updateType": "",
"formData": {}
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/s3bucket', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"updateType": "",
"formData": {}
}),
});
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);
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(
'/apps/s3bucket',
{
"updateType": "",
"formData": {}
}
);
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}`);
}
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/apps/s3bucket',
{
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({
"updateType": "",
"formData": {}
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/s3bucket",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"updateType": "",
"formData": {}
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/s3bucket');
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({
'updateType': '',
'formData': {}
}),
]);
$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']);
DELETE /apps/s3bucket
Delete S3 bucket.
Auth apikey · Success 200
:::note Used by the web app
pages/AWSS3Bucket.jsx, pages/AddS3Bucket.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/s3bucket' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/s3bucket', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/s3bucket',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/s3bucket',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/s3bucket",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/s3bucket');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/s3bucket/:id
Get S3 bucket.
Auth apikey
:::note Used by the web app
pages/AddS3Bucket.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Bucket object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID', {
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);
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(
'/apps/s3bucket/APPS_ID'
);
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}`);
}
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/apps/s3bucket/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID');
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 S3BucketNotFound_404
PUT /apps/s3bucket/:id
Update S3 bucket.
Auth apikey · Success 200
:::note Used by the web app
pages/AddS3Bucket.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Bucket object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/s3bucket/APPS_ID'
);
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}`);
}
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/apps/s3bucket/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/s3bucket/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 S3BucketNotFound_404
GET /apps/sendgrid
Get all SendGrid.
Auth apikey
:::note Used by the web app
pages/AddSendgrid.jsx, pages/Sendgrid.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Sendgrid objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/sendgrid?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sendgrid?p=1&n=25', {
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);
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(
'/apps/sendgrid?p=1&n=25'
);
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}`);
}
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/apps/sendgrid?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/sendgrid?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sendgrid?p=1&n=25');
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']);
POST /apps/sendgrid
Create SendGrid.
Auth apikey · Success 201
:::note Used by the web app
pages/AddSendgrid.jsx, pages/Sendgrid.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
apiKey | string | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Sendgrid object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/sendgrid' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sendgrid', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/sendgrid',
{
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/sendgrid',
{
method: 'POST',
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({
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/sendgrid",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sendgrid');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'apiKey': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/sendgrid
Delete SendGrid.
Auth apikey · Success 200
:::note Used by the web app
pages/AddSendgrid.jsx, pages/Sendgrid.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/sendgrid' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sendgrid', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/sendgrid',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/sendgrid',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/sendgrid",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sendgrid');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoSendgridSelected_400
GET /apps/sendgrid/:id
Get SendGrid.
Auth apikey
:::note Used by the web app
pages/AddSendgrid.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Sendgrid object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID', {
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);
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(
'/apps/sendgrid/APPS_ID'
);
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}`);
}
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/apps/sendgrid/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID');
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 SendgridNotFound_404
PUT /apps/sendgrid/:id
Update SendGrid.
Auth apikey · Success 200
:::note Used by the web app
pages/AddSendgrid.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Sendgrid object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/sendgrid/APPS_ID'
);
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}`);
}
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/apps/sendgrid/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sendgrid/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 SendgridNotFound_404
GET /apps/ses
Get all SES.
Auth apikey
:::note Used by the web app
pages/AddSes.jsx, pages/Ses.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Ses objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/ses?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ses?p=1&n=25', {
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);
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(
'/apps/ses?p=1&n=25'
);
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}`);
}
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/apps/ses?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/ses?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ses?p=1&n=25');
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']);
POST /apps/ses
Create SES.
Auth apikey · Success 201
:::note Used by the web app
pages/AddSes.jsx, pages/Ses.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
accessKeyId | string | — |
secretAccessKey | string | — |
region | string | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Ses object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/ses' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"accessKeyId": "",
"secretAccessKey": "",
"region": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ses', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"accessKeyId": "",
"secretAccessKey": "",
"region": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/ses',
{
"name": "",
"accessKeyId": "",
"secretAccessKey": "",
"region": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/ses',
{
method: 'POST',
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({
"name": "",
"accessKeyId": "",
"secretAccessKey": "",
"region": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/ses",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"accessKeyId": "",
"secretAccessKey": "",
"region": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ses');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'accessKeyId': '',
'secretAccessKey': '',
'region': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/ses
Delete SES.
Auth apikey · Success 200
:::note Used by the web app
pages/AddSes.jsx, pages/Ses.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/ses' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ses', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/ses',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/ses',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/ses",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ses');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoSESSelected_400
GET /apps/ses/:id
Get SES.
Auth apikey
:::note Used by the web app
pages/AddSes.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Ses object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/ses/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ses/APPS_ID', {
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);
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(
'/apps/ses/APPS_ID'
);
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}`);
}
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/apps/ses/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/ses/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ses/APPS_ID');
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 SESNotFound_404
PUT /apps/ses/:id
Update SES.
Auth apikey · Success 200
:::note Used by the web app
pages/AddSes.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Ses object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/ses/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/ses/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/ses/APPS_ID'
);
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}`);
}
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/apps/ses/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/ses/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/ses/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 SESNotFound_404
GET /apps/smtp
Get all SMTP.
Auth apikey
:::note Used by the web app
components/EmailMessageSend.jsx, pages/AIGeniePage.jsx, pages/AddSMTP.jsx and 2 more
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Smtp objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/smtp?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/smtp?p=1&n=25', {
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);
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(
'/apps/smtp?p=1&n=25'
);
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}`);
}
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/apps/smtp?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/smtp?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/smtp?p=1&n=25');
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']);
POST /apps/smtp
Create SMTP.
Auth apikey · Success 201
:::note Used by the web app
components/EmailMessageSend.jsx, pages/AIGeniePage.jsx, pages/AddSMTP.jsx and 2 more
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
host | string | — |
port | number | — |
username | string | — |
password | string | — |
secure | boolean | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Smtp object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/smtp' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"host": "",
"port": "",
"username": "",
"password": "",
"secure": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/smtp', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"host": "",
"port": "",
"username": "",
"password": "",
"secure": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/smtp',
{
"name": "",
"host": "",
"port": "",
"username": "",
"password": "",
"secure": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/smtp',
{
method: 'POST',
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({
"name": "",
"host": "",
"port": "",
"username": "",
"password": "",
"secure": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/smtp",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"host": "",
"port": "",
"username": "",
"password": "",
"secure": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/smtp');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'host': '',
'port': '',
'username': '',
'password': '',
'secure': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/smtp
Delete SMTP.
Auth apikey · Success 200
:::note Used by the web app
components/EmailMessageSend.jsx, pages/AIGeniePage.jsx, pages/AddSMTP.jsx and 2 more
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/smtp' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/smtp', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/smtp',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/smtp',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/smtp",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/smtp');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoSMTPSelected_400
GET /apps/smtp/:id
Get SMTP.
Auth apikey
:::note Used by the web app
pages/AddSMTP.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Smtp object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID', {
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);
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(
'/apps/smtp/APPS_ID'
);
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}`);
}
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/apps/smtp/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID');
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 SMTPNotFound_404
PUT /apps/smtp/:id
Update SMTP.
Auth apikey · Success 200
:::note Used by the web app
pages/AddSMTP.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Smtp object.
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/smtp/APPS_ID'
);
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}`);
}
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/apps/smtp/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/smtp/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 SMTPNotFound_404
GET /apps/sparkpost
Get all SparkPost.
Auth apikey
:::note Used by the web app
pages/AddSparkpost.jsx, pages/Sparkpost.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Sparkpost objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/sparkpost?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sparkpost?p=1&n=25', {
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);
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(
'/apps/sparkpost?p=1&n=25'
);
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}`);
}
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/apps/sparkpost?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/sparkpost?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sparkpost?p=1&n=25');
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']);
POST /apps/sparkpost
Create SparkPost.
Auth apikey · Success 201
:::note Used by the web app
pages/AddSparkpost.jsx, pages/Sparkpost.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
name | string | — |
apiKey | string | — |
endpoint | string | — |
fromEmail | string | — |
fromName | string | — |
Response — data is one Sparkpost object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/sparkpost' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"apiKey": "",
"endpoint": "",
"fromEmail": "",
"fromName": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sparkpost', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"apiKey": "",
"endpoint": "",
"fromEmail": "",
"fromName": ""
}),
});
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);
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.post(
'/apps/sparkpost',
{
"name": "",
"apiKey": "",
"endpoint": "",
"fromEmail": "",
"fromName": ""
}
);
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}`);
}
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/apps/sparkpost',
{
method: 'POST',
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({
"name": "",
"apiKey": "",
"endpoint": "",
"fromEmail": "",
"fromName": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/sparkpost",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"apiKey": "",
"endpoint": "",
"fromEmail": "",
"fromName": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sparkpost');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'apiKey': '',
'endpoint': '',
'fromEmail': '',
'fromName': ''
}),
]);
$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']);
DELETE /apps/sparkpost
Delete SparkPost.
Auth apikey · Success 200
:::note Used by the web app
pages/AddSparkpost.jsx, pages/Sparkpost.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/sparkpost' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sparkpost', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/sparkpost',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/sparkpost',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/sparkpost",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sparkpost');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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 NoSparkpostSelected_400
GET /apps/sparkpost/:id
Get SparkPost.
Auth apikey
:::note Used by the web app
pages/AddSparkpost.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Sparkpost object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X GET 'https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID', {
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);
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(
'/apps/sparkpost/APPS_ID'
);
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}`);
}
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/apps/sparkpost/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID');
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 SparkpostNotFound_404
PUT /apps/sparkpost/:id
Update SparkPost.
Auth apikey · Success 200
:::note Used by the web app
pages/AddSparkpost.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Sparkpost object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/sparkpost/APPS_ID'
);
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}`);
}
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/apps/sparkpost/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/sparkpost/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 SparkpostNotFound_404
GET /apps/telegram
Get all Telegram apps.
Auth apikey
:::note Used by the web app
pages/AddTelegram.jsx, pages/Telegram.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of TelegramApp objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/telegram?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/telegram?p=1&n=25', {
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);
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(
'/apps/telegram?p=1&n=25'
);
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}`);
}
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/apps/telegram?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/telegram?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/telegram?p=1&n=25');
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']);
POST /apps/telegram
Create Telegram app.
Auth apikey · Success 201
:::note Used by the web app
pages/AddTelegram.jsx, pages/Telegram.jsx
:::
Request body
| Field | Required | Default |
|---|---|---|
name | yes | — |
token | yes | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/telegram' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"token": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/telegram', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"token": ""
}),
});
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);
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.post(
'/apps/telegram',
{
"name": "",
"token": ""
}
);
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}`);
}
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/apps/telegram',
{
method: 'POST',
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({
"name": "",
"token": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/telegram",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"token": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/telegram');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'token': ''
}),
]);
$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']);
DELETE /apps/telegram
Delete Telegram apps.
Auth apikey · Success 200
:::note Used by the web app
pages/AddTelegram.jsx, pages/Telegram.jsx
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/telegram' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/telegram', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/telegram',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/telegram',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/telegram",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/telegram');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/telegram/:id
Get Telegram app.
Auth apikey
:::note Used by the web app
pages/AddTelegram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID', {
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);
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(
'/apps/telegram/APPS_ID'
);
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}`);
}
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/apps/telegram/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID');
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 TelegramAppNotFound_404
PUT /apps/telegram/:id
Update Telegram app.
Auth apikey · Success 200
:::note Used by the web app
pages/AddTelegram.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Default |
|---|---|
name | — |
token | — |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"token": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID', {
method: 'PUT',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"token": ""
}),
});
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);
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(
'/apps/telegram/APPS_ID',
{
"name": "",
"token": ""
}
);
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}`);
}
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/apps/telegram/APPS_ID',
{
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({
"name": "",
"token": ""
});
console.log(data);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"token": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/telegram/APPS_ID');
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({
'name': '',
'token': ''
}),
]);
$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 TelegramAppNotFound_404
GET /apps/whatsapp
Get all WhatsApp.
Auth apikey
:::note Used by the web app
components/GenerateWhatsappTemplateModal.jsx, components/WhatsappMessageSend.jsx, pages/AIGeniePage.jsx and 6 more
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of MetaApp objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/whatsapp?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/whatsapp?p=1&n=25', {
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);
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(
'/apps/whatsapp?p=1&n=25'
);
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}`);
}
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/apps/whatsapp?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/whatsapp?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/whatsapp?p=1&n=25');
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']);
POST /apps/whatsapp
Create WhatsApp.
Auth apikey · Success 201
:::note Used by the web app
components/GenerateWhatsappTemplateModal.jsx, components/WhatsappMessageSend.jsx, pages/AIGeniePage.jsx and 6 more
:::
Request body
| Field | Type | Default |
|---|---|---|
countryCode | string | — |
number | string | — |
appID | string | — |
numberID | string | — |
businessID | string | — |
PAT | string | — |
pin | number | — |
appSecret | string | — |
name | string | — |
Response — data is one MetaApp object.
curl -X POST 'https://api.leadx.in/api/key/protected/apps/whatsapp' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"countryCode": "",
"number": "",
"appID": "",
"numberID": "",
"businessID": "",
"PAT": "",
"pin": "",
"appSecret": "",
"name": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/whatsapp', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"countryCode": "",
"number": "",
"appID": "",
"numberID": "",
"businessID": "",
"PAT": "",
"pin": "",
"appSecret": "",
"name": ""
}),
});
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);
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.post(
'/apps/whatsapp',
{
"countryCode": "",
"number": "",
"appID": "",
"numberID": "",
"businessID": "",
"PAT": "",
"pin": "",
"appSecret": "",
"name": ""
}
);
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}`);
}
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/apps/whatsapp',
{
method: 'POST',
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({
"countryCode": "",
"number": "",
"appID": "",
"numberID": "",
"businessID": "",
"PAT": "",
"pin": "",
"appSecret": "",
"name": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/whatsapp",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"countryCode": "",
"number": "",
"appID": "",
"numberID": "",
"businessID": "",
"PAT": "",
"pin": "",
"appSecret": "",
"name": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/whatsapp');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'countryCode': '',
'number': '',
'appID': '',
'numberID': '',
'businessID': '',
'PAT': '',
'pin': '',
'appSecret': '',
'name': ''
}),
]);
$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']);
GET /apps/whatsapp/:id
Get WhatsApp.
Auth apikey
:::note Used by the web app
pages/AddWhatsapp.jsx, pages/Whatsapp.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID', {
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);
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(
'/apps/whatsapp/APPS_ID'
);
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}`);
}
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/apps/whatsapp/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID');
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 WhatsappNotFound_404
PUT /apps/whatsapp/:id
Update WhatsApp.
Auth apikey · Success 200
:::note Used by the web app
pages/AddWhatsapp.jsx, pages/Whatsapp.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/whatsapp/APPS_ID'
);
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}`);
}
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/apps/whatsapp/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/whatsapp/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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 WhatsappNotFound_404
POST /apps/whatsapp/oauth/callback
Complete WhatsApp OAuth.
Auth apikey · Success 200
:::note Used by the web app
pages/AddWhatsapp.jsx
:::
Request body
| Field | Type | Required | Default |
|---|---|---|---|
code | yes | — | |
state | string | yes | — |
sessionInfo | object | {} | |
pin | — | ||
name | — | ||
redirectUri | "" |
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X POST 'https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/callback' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"code": "",
"state": "",
"sessionInfo": {},
"pin": "",
"name": "",
"redirectUri": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/callback', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"code": "",
"state": "",
"sessionInfo": {},
"pin": "",
"name": "",
"redirectUri": ""
}),
});
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);
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.post(
'/apps/whatsapp/oauth/callback',
{
"code": "",
"state": "",
"sessionInfo": {},
"pin": "",
"name": "",
"redirectUri": ""
}
);
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}`);
}
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/apps/whatsapp/oauth/callback',
{
method: 'POST',
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({
"code": "",
"state": "",
"sessionInfo": {},
"pin": "",
"name": "",
"redirectUri": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/callback",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"code": "",
"state": "",
"sessionInfo": {},
"pin": "",
"name": "",
"redirectUri": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/callback');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'code': '',
'state': '',
'sessionInfo': {},
'pin': '',
'name': '',
'redirectUri': ''
}),
]);
$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 InvalidRequest_400
POST /apps/whatsapp/oauth/init
Init WhatsApp OAuth.
Auth apikey · Success 200
:::note Used by the web app
pages/AddWhatsapp.jsx
:::
Request body
| Field | Type | Default |
|---|---|---|
redirectPath | string | /apps/whatsapp |
Response — data is one App object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
curl -X POST 'https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/init' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"redirectPath": "/apps/whatsapp"
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/init', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"redirectPath": "/apps/whatsapp"
}),
});
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);
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.post(
'/apps/whatsapp/oauth/init',
{
"redirectPath": "/apps/whatsapp"
}
);
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}`);
}
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/apps/whatsapp/oauth/init',
{
method: 'POST',
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({
"redirectPath": "/apps/whatsapp"
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/init",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"redirectPath": "/apps/whatsapp"
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/whatsapp/oauth/init');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'redirectPath': '/apps/whatsapp'
}),
]);
$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 InvalidRequest_400
GET /apps/whatsapp/verify/:id
Register the WhatsApp number and subscribe its webhook.
Auth apikey · Success 201
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one MetaApp object.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/whatsapp/verify/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/whatsapp/verify/APPS_ID', {
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);
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(
'/apps/whatsapp/verify/APPS_ID'
);
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}`);
}
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/apps/whatsapp/verify/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/whatsapp/verify/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/whatsapp/verify/APPS_ID');
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']);
GET /apps/zoom
Get Zoom accounts.
Auth apikey
:::note Used by the web app
components/MemberZoomAssignment.jsx, pages/AddMeeting.jsx, pages/AddZoom.jsx and 1 more
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of ZoomAccount objects, alongside the pagination fields described in Response format.
curl -X GET 'https://api.leadx.in/api/key/protected/apps/zoom?p=1&n=25' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/zoom?p=1&n=25', {
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);
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(
'/apps/zoom?p=1&n=25'
);
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}`);
}
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/apps/zoom?p=1&n=25',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/zoom?p=1&n=25",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/zoom?p=1&n=25');
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']);
POST /apps/zoom
Create Zoom account.
Auth apikey · Success 200
:::note Used by the web app
components/MemberZoomAssignment.jsx, pages/AddMeeting.jsx, pages/AddZoom.jsx and 1 more
:::
Request body
| Field | Type | Required | Default |
|---|---|---|---|
name | yes | — | |
authType | string | manual | |
accountId | yes | — | |
clientId | yes | — | |
clientSecret | yes | — |
curl -X POST 'https://api.leadx.in/api/key/protected/apps/zoom' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "",
"authType": "manual",
"accountId": "",
"clientId": "",
"clientSecret": ""
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/zoom', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"authType": "manual",
"accountId": "",
"clientId": "",
"clientSecret": ""
}),
});
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);
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.post(
'/apps/zoom',
{
"name": "",
"authType": "manual",
"accountId": "",
"clientId": "",
"clientSecret": ""
}
);
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}`);
}
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/apps/zoom',
{
method: 'POST',
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({
"name": "",
"authType": "manual",
"accountId": "",
"clientId": "",
"clientSecret": ""
});
console.log(data);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/zoom",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"name": "",
"authType": "manual",
"accountId": "",
"clientId": "",
"clientSecret": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/zoom');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'name': '',
'authType': 'manual',
'accountId': '',
'clientId': '',
'clientSecret': ''
}),
]);
$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']);
DELETE /apps/zoom
Delete Zoom accounts.
Auth apikey · Success 200
:::note Used by the web app
components/MemberZoomAssignment.jsx, pages/AddMeeting.jsx, pages/AddZoom.jsx and 1 more
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
curl -X DELETE 'https://api.leadx.in/api/key/protected/apps/zoom' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/zoom', {
method: 'DELETE',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}),
});
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);
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.delete(
'/apps/zoom',
{
"ids": [
"RESOURCE_ID"
],
"selectAll": false
}
);
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}`);
}
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/apps/zoom',
{
method: 'DELETE',
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({
"ids": [
"RESOURCE_ID"
],
"selectAll": false
});
console.log(data);
import os
import requests
res = requests.delete(
"https://api.leadx.in/api/key/protected/apps/zoom",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"ids": [
"RESOURCE_ID"
],
"selectAll": False
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/zoom');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'ids': [
'RESOURCE_ID'
],
'selectAll': false
}),
]);
$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']);
GET /apps/zoom/:id
Get Zoom account.
Auth apikey
:::note Used by the web app
pages/AddZoom.jsx, pages/ZoomAuthCallback.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
curl -X GET 'https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID', {
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);
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(
'/apps/zoom/APPS_ID'
);
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}`);
}
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/apps/zoom/APPS_ID',
{
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);
import os
import requests
res = requests.get(
"https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID');
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']);
PUT /apps/zoom/:id
Update Zoom account.
Auth apikey · Success 200
:::note Used by the web app
pages/AddZoom.jsx, pages/ZoomAuthCallback.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
curl -X PUT 'https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID', {
method: 'PUT',
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);
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(
'/apps/zoom/APPS_ID'
);
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}`);
}
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/apps/zoom/APPS_ID',
{
method: 'PUT',
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);
import os
import requests
res = requests.put(
"https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/zoom/APPS_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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']);
POST /apps/zoom/redirect
Get Zoom redirect URI.
Auth apikey
curl -X POST 'https://api.leadx.in/api/key/protected/apps/zoom/redirect' \
-H 'apikey: $LEADX_API_KEY'
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/apps/zoom/redirect', {
method: 'POST',
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);
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.post(
'/apps/zoom/redirect'
);
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}`);
}
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/apps/zoom/redirect',
{
method: 'POST',
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);
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/apps/zoom/redirect",
headers={"apikey": os.environ["LEADX_API_KEY"]},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/apps/zoom/redirect');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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']);