Skip to main content
GET
/
api
/
get-settings.php
Get Settings
curl --request GET \
  --url https://api.example.com/api/get-settings.php
{
  "success": true,
  "settings": {
    "systemPrompt": "<string>",
    "welcomeMessage": "<string>",
    "errorMessage": "<string>",
    "contextMessagesCount": 123,
    "calendarEnabled": true,
    "botMode": "<string>",
    "botName": "<string>"
  }
}

Overview

Retrieves all general bot settings including system prompts, welcome messages, bot mode, and calendar integration status.

Request

No parameters required for this endpoint.
curl https://your-domain.com/api/get-settings.php

Response

success
boolean
required
Indicates if the request was successful
settings
object
required
Contains all configuration settings
systemPrompt
string
The AI system prompt that defines the bot’s behaviorDefault: "Eres un asistente virtual útil y amigable."
welcomeMessage
string
Message sent when a user first contacts the botDefault: "Hola! Soy un asistente virtual. ¿En qué puedo ayudarte?"
errorMessage
string
Fallback message when no relevant information is foundDefault: "Lo siento, no encontré información relevante. Un operador te atenderá pronto."
contextMessagesCount
integer
Number of previous messages to include in conversation contextDefault: 5
calendarEnabled
boolean
Whether calendar integration is enabledDefault: false
botMode
string
Operating mode of the bot: "ai" (RAG mode) or "classic" (flow-based)Default: "ai"
botName
string
Display name of the botDefault: "WhatsApp Bot"

Success Response Example

{
  "success": true,
  "settings": {
    "systemPrompt": "Eres un asistente virtual útil y amigable.",
    "welcomeMessage": "Hola! Soy un asistente virtual. ¿En qué puedo ayudarte?",
    "errorMessage": "Lo siento, no encontré información relevante. Un operador te atenderá pronto.",
    "contextMessagesCount": 5,
    "calendarEnabled": false,
    "botMode": "ai",
    "botName": "WhatsApp Bot"
  }
}

Error Response Example

{
  "success": false,
  "error": "Error al obtener configuración"
}

Error Handling

Status CodeDescription
200Settings retrieved successfully
500Internal server error

Implementation Details

The endpoint:
  1. Queries the settings table for all configuration key-value pairs
  2. Maps database keys to JSON response keys
  3. Returns default values if settings are not configured
  4. Converts string booleans to actual boolean types
Source: api/get-settings.php:9-48

Build docs developers (and LLMs) love