Skip to main content

Toggle Section Visibility

POST /tenant/{tenantId}/dashboard/toggle-section
Toggles the visibility of a single landing page section. Updates the visual_effects.sections_order array in the tenant’s customization.

Path Parameters

tenantId
integer
required
The tenant ID

Body Parameters

section
string
required
Section identifier to toggle. Common sections:
  • hero - Hero section
  • products - Products catalog
  • services - Services grid
  • about - About section
  • testimonials - Customer testimonials
  • faq - Frequently asked questions
  • contact - Contact information
  • payment_methods - Payment methods display
  • branches - Physical branches (Plan 3 only)
visible
boolean
required
Section visibility state. true to show, false to hide.

Response

success
boolean
Operation success status
{
  "success": true
}

Error Response

{
  "success": false,
  "message": "Error: validation error details"
}

Behavior

  • If the section already exists in sections_order, updates its visible property
  • If the section doesn’t exist, adds it with the specified visibility and assigns the next available order position
  • Automatically calls syncSectionsConfig() to maintain consistency between sections_order and sections_config

Save Section Order

POST /tenant/{tenantId}/dashboard/save-section-order
Saves the complete section ordering configuration for the tenant’s landing page. This endpoint is typically used after drag-and-drop reordering in the dashboard.

Path Parameters

tenantId
integer
required
The tenant ID

Body Parameters

sections_order
array
required
Array of section configuration objects

Response

success
boolean
Operation success status
message
string
Result message
{
  "success": true,
  "message": "Orden de secciones guardado correctamente"
}

Error Response

{
  "success": false,
  "message": "Error: validation error details"
}

Storage Location

The sections order is stored in:
tenant_customization.visual_effects.sections_order
After saving, the system automatically synchronizes sections_config to maintain consistency.

Toggle Branches Section (Plan 3)

POST /tenant/{tenantId}/branches/toggle
Toggles the visibility of the branches section for Plan 3 (Visión) tenants. This is stored separately from the general section configuration.

Path Parameters

tenantId
integer
required
The tenant ID (must have Plan 3)

Body Parameters

enabled
boolean
required
Enable or disable the branches section

Response

success
boolean
Operation success status
enabled
boolean
Current enabled state
message
string
Result message
{
  "success": true,
  "enabled": true,
  "message": "Sección de sucursales activada"
}

Error Response

Plan restriction:
{
  "success": false,
  "message": "La sección de sucursales solo está disponible en el Plan Visión"
}

Storage Location

The branches section visibility is stored in:
tenant.settings.engine_settings.branches.enabled

Section Configuration Reference

The sections_order and sections_config data structures control both the visibility and ordering of landing page sections.

Sections Order Structure

{
  "visual_effects": {
    "sections_order": [
      {
        "name": "hero",
        "visible": true,
        "order": 0
      },
      {
        "name": "products",
        "visible": true,
        "order": 1
      }
    ]
  }
}

Available Sections

SectionDescriptionPlan Requirements
heroMain hero section with title and CTAAll plans
productsProduct catalog gridAll plans
servicesServices gridAll plans
aboutAbout section with text and imageAll plans
testimonialsCustomer testimonialsPlan 2+
faqFrequently asked questionsPlan 2+
contactContact information and formAll plans
payment_methodsPayment methods displayAll plans
branchesPhysical branch locationsPlan 3 only
ctaCall-to-action bannerPlan 3 only

Synchronization Behavior

When sections_order is updated:
  1. The system saves the array to customization.visual_effects.sections_order
  2. Calls syncSectionsConfig() to update customization.sections_config
  3. sections_config maintains individual section visibility flags for backward compatibility
Both structures remain in sync automatically.

Update Header Top Bar (Plan 2+)

POST /tenant/{tenantId}/update-header-top
Configures the top header bar for Plan 2 (Crecimiento) and Plan 3 (Visión) tenants.

Path Parameters

tenantId
integer
required
The tenant ID

Body Parameters

enabled
boolean
required
Enable or disable the header top bar
text
string
Text content to display in the header top bar

Response

success
boolean
Operation success status
message
string
Result message
{
  "success": true,
  "message": "Header Top actualizado"
}

Error Response

Plan restriction:
{
  "success": false,
  "message": "Header Top requiere Plan CRECIMIENTO o superior"
}

Storage Location

tenant.settings.engine_settings.header_top

Update CTA Section (Plan 3)

POST /tenant/{tenantId}/update-cta
Configures the call-to-action banner section for Plan 3 (Visión) tenants.

Path Parameters

tenantId
integer
required
The tenant ID (must have Plan 3)

Body Parameters

cta_title
string
CTA section title
cta_subtitle
string
CTA section subtitle
cta_button_text
string
Button text
Button URL (must be valid URL format)

Response

success
boolean
Operation success status
message
string
Result message
{
  "success": true,
  "message": "CTA actualizado"
}

Storage Location

tenant_customization.cta_title
tenant_customization.cta_subtitle
tenant_customization.cta_button_text
tenant_customization.cta_button_link

Build docs developers (and LLMs) love