Skip to main content
The Promotions section (/panel/sistema/promociones) lets administrators create and manage promotional banners displayed to users inside the platform. Each promotion consists of an image, an internal title, a call-to-action button with a link, and visibility and audience settings. Data is stored in the promotions table; only records where deleted = false are shown.

Promotion fields

FieldDescription
titleInternal identifier title — visible only in the panel (max 140 characters)
btn_textButton label shown to users (max 80 characters)
btn_urlFull valid URL the button links to
imageBanner background image (converted to WebP at quality 0.78, max 1600×1600 px)
rolesArray of user types that can see the promotion: Maestro, Tutor, Alumno
visibleBoolean controlling whether the promotion is active (true) or hidden (false)

Creating a promotion

1

Open the form

Click the Add button in the top-right corner of the Promotions page. A modal with the creation form opens.
2

Fill in the details

  • Visibility: toggle the eye switch to control whether the promotion will be shown to users.
  • Available for: select one or more roles (Teachers, Tutors, Students) that will see the promotion.
  • Title: enter an internal identifier name.
  • Button text: the label users will see on the action button.
  • Button URL: the full link the button should open.
  • Image: upload a PNG, JPEG, or WebP image. A real-time preview is shown.
3

Save

The Save button is enabled only when title, btn_text, btn_url, and image all have values. On save, the new promotion appears at the top of the list without a page reload.

Create/update endpoint

POST /api/admin/create-update-promotions
Content-Type: multipart/form-data
FieldTypeDescription
promoJSON stringPromotion object
imageFile (optional)Image file to upload
Example promo JSON:
{
  "id": null,
  "title": "Summer discount",
  "btn_text": "View offer",
  "btn_url": "https://example.com/offer",
  "roles": ["Alumno", "Tutor"],
  "visible": true
}
Response:
{
  "success": true,
  "data": { ...promotion }
}

Editing a promotion

Click the gear icon on a promotion row. The same modal opens with the current data pre-filled. On save, the row updates in real time.
When editing, if no new image is selected the existing image is kept. It is only replaced when a new file is uploaded.

Deleting a promotion

Click the trash icon on a row and confirm in the alert dialog. Deletion is permanent and cannot be reversed from the interface.

Delete endpoint

POST /api/admin/delete-promotion
Content-Type: multipart/form-data
FieldTypeDescription
recordstring (UUID)ID of the promotion to delete
Response:
{ "success": true }
Deleting a promotion is irreversible. The promotion data and its associated image cannot be recovered once deleted.

Visibility and audience

  • A promotion with visible: false is not shown to users even if it is configured for certain roles. Use this to prepare promotions in advance.
  • If the roles array is empty, the promotion will not be shown to any user type.
  • The three available roles are: Maestros, Tutores, and Alumnos.

Required permissions

The administrator must have the system:promotions area enabled in their role to access this section.