List chatbot scripts
Return saved website scripts (the chatbot widget and vehicle-page scripts), one page at a time. The receptionist's "Chatbot Script" task uses this list to decide whether it is done.
Filter by dealer group, rooftop, website and other fields. enterpriseId and teamId are optional: without them the list covers every rooftop. Nothing is stored.
Auth: Bearer token of a signed-in user, checked with the identity service. The route does not limit results to the caller's dealer group. Rate limit: not documented. Processing: synchronous, one database query and count.
Before you call it
- Pass
enterpriseIdandteamIdto see only one rooftop's scripts. - The Get Started page calls it with
enterpriseId,teamId,pageNo=1andbatch=100. It then picks the script whose website matches the rooftop's website and has the chatbot on. The task shows as done when that script has ascriptUrl.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pageNo | integer | Optional | Page number, starting at 1. Default: 1. |
batch | integer | Optional | Page size, 1 to 100. Default: 10. |
enterpriseId | string | Optional | Exact match. |
teamId | string | Optional | Exact match. |
enterpriseName, teamName | string | Optional | Contains, not case-sensitive. |
websiteUrl | string | Optional | Contains, not case-sensitive. http(s):// and a trailing / are ignored. |
scriptUrl, scriptId, createdBy | string | Optional | Exact match. |
websiteProvider | string | Optional | Contains, not case-sensitive. |
sortBy | string | Optional | createdAt (default) or updatedAt. |
order | string | Optional | asc or desc (default). |
startDate, endDate | string | Optional | YYYY-MM-DD. Filters on created date (UTC, inclusive). |
Sample request
curl -G "https://api.spyne.ai/central-config/v1/smartview-scripts" \
-H "Authorization: Bearer YOUR_TOKEN" \
--data-urlencode "enterpriseId=<enterpriseId>" \
--data-urlencode "teamId=<teamId>" \
--data-urlencode "pageNo=1" \
--data-urlencode "batch=100"import requests
res = requests.get(
"https://api.spyne.ai/central-config/v1/smartview-scripts",
headers={"Authorization": "Bearer YOUR_TOKEN"},
params={"enterpriseId": "<enterpriseId>", "teamId": "<teamId>", "pageNo": 1, "batch": 100},
)
print(res.status_code, res.json())const params = new URLSearchParams({ enterpriseId: '<enterpriseId>', teamId: '<teamId>', pageNo: '1', batch: '100' });
const res = await fetch(`https://api.spyne.ai/central-config/v1/smartview-scripts?${params}`, {
headers: { Authorization: 'Bearer YOUR_TOKEN' },
});
console.log(res.status, await res.json());Sample response
{
"success": true,
"message": "Smartview scripts retrieved successfully",
"data": {
"scripts": [
{
"_id": "<id>",
"enterpriseId": "<enterpriseId>",
"teamId": "<teamId>",
"enterpriseName": "Example Motors Group",
"teamName": "Example Motors",
"userId": "<userId>",
"domain": "publish",
"entity": "SMARTVIEW",
"type": "single",
"entityconfig": {
"scriptId": "<scriptId>",
"scriptUrl": "https://example.com/script.js",
"websiteUrl": "https://www.examplemotors.example",
"websiteProvider": "dealeron",
"active": 1,
"selectedTeamId": ["<teamId>"],
"globalConfigs": { "chatbotConfigs": { "enabled": true } },
"version": "v2"
},
"createdAt": "2026-10-01T00:00:00.000Z",
"updatedAt": "2026-10-12T00:00:00.000Z"
}
],
"pageNo": 1,
"batch": 100,
"total": 1
}
}{ "success": false, "message": "Validation error", "error": "Invalid query parameters", "errors": [{ "code": "too_big", "path": ["batch"], "message": "Number must be less than or equal to 100" }] }{ "status": "401", "message": "Invalid Auth key" }{ "success": false, "message": "Failed to fetch smartview scripts", "error": "<error message>" }Response parameters (200)
| Parameter | Type | Description |
|---|---|---|
data.scripts[] | array | Script records. |
entityconfig.scriptUrl | string | Script to embed on the dealer website. Its presence marks the Chatbot Script task done in the console UI. |
entityconfig.scriptId | string | Script id. Send it back to update this script. |
entityconfig.websiteUrl, websiteProvider | string | Website the script is for. |
entityconfig.globalConfigs.chatbotConfigs.enabled | boolean | Chatbot is on. |
entityconfig.vdpConfigs, vlpConfigs | object | Vehicle-page script settings, when set. |
data.pageNo, data.batch, data.total | number | Paging. total counts all matches. |
Errors
| Status | Reason | When it happens |
|---|---|---|
400 | Validation error | pageNo or batch is out of range, or a date is not YYYY-MM-DD. |
401 | Invalid Auth key | Missing or rejected token. |
500 | Failed to fetch smartview scripts | The database query failed. |
What happens next
If there is no chatbot script for the rooftop's website, create one with Save a chatbot script. The console UI never writes the Chatbot Script task to the checklist. It works out "done" from this list each time.
Updated about 1 hour ago
