The Medications API exposes MELIKA’s drug catalog for use across the platform — from patient-facing drug information pages to physician prescribing workflows. Medications are classified as either OTC (over-the-counter, no prescription required) or Rx (prescription-only), are linked to medical specialties for contextual filtering, and carry structured presentation data. All read endpoints are public with no authentication required, though write operations are restricted to admin routes at the application layer.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Imjuanisss/proyecto-melika/llms.txt
Use this file to discover all available pages before exploring further.
OTC vs Rx Classification
OTC — Over the Counter
Medications available without a prescription. Suitable for display in patient-facing catalogs, symptom checkers, and general wellness flows. Filtered with
tipo=OTC.Rx — Prescription Only
Medications that require a physician’s prescription. These appear in clinical workflows, physician prescribing panels, and are referenced inside clinical records. Filtered with
tipo=Rx.Data Model
Themedicamentos table stores the full drug profile including commercial identity, active ingredient, lab origin, and specialty linkage.
| Field | Type | Notes |
|---|---|---|
id | integer | Primary key |
nombre_comercial | VARCHAR(150) | Brand/commercial name |
principio_activo | VARCHAR(150) | Generic active ingredient name |
principio_activa | VARCHAR(150) | Legacy duplicate of principio_activo — both are kept in sync on write |
laboratorio | VARCHAR(100) | Manufacturing laboratory |
categoria | VARCHAR(100) | Legacy text category field (superseded by id_especialidad) |
id_especialidad | integer | FK → specialties (contextual linkage for catalog filtering) |
tipo | ENUM | OTC or Rx (enforced by CHECK constraint) |
descripcion | TEXT | Clinical description |
indicaciones | TEXT | Clinical indications |
posologia | TEXT | Dosage guidance |
contraindicaciones | TEXT | Contraindications |
presentaciones | TEXT | Available forms and dosages (e.g. tablets, syrup) |
registro_invima | VARCHAR(50) | INVIMA registration number (unique when set) |
imagen_url | VARCHAR(255) | URL to product image |
activo | boolean | Only TRUE records appear in public queries. Default TRUE |
created_at | timestamp | Auto-generated |
updated_at | timestamp | Auto-updated |
All public-facing endpoints (
GET /medicamentos, GET /medicamentos/:id) return only active medications (activo = TRUE). Inactive entries are accessible only via the admin route.Endpoints
GET /medicamentos
Returns a filtered list of active medications. Supports three independent query filters that can be combined freely:tipo restricts by prescription class, id_especialidad restricts by specialty linkage, and buscar performs a case-insensitive full-text search across both nombre_comercial and principio_activo. Results are ordered alphabetically by nombre_comercial.
Authentication: None (public)
Filter by prescription classification. Accepted values:
OTC, Rx. Omit to return both types.Filter by specialty. Pass a numeric specialty ID to restrict results to medications linked to that discipline. Pass
"Todos" or omit entirely to return medications across all specialties.Case-insensitive search string applied via
ILIKE against both nombre_comercial and principio_activo. Partial matches are supported.Medication identifier.
Commercial/brand name (e.g.
"Metformina 500").Generic active ingredient (e.g.
"metformina").Manufacturing laboratory name.
"OTC" or "Rx".Clinical description of the medication.
Available forms and dosages.
URL to the product image.
ID of the linked specialty (nullable).
Always
true in public responses.GET /medicamentos?tipo=Rx&buscar=metformina:
GET /medicamentos/admin
Returns all medications including inactive ones (activo = FALSE) for administrative management. Intended for use in admin dashboards where operators manage the drug catalog.
Authentication: None at route level (enforced at the admin layer)
Medication identifier.
Commercial name.
Active ingredient.
Manufacturing laboratory.
"OTC" or "Rx".Active status — includes both
true and false records.GET /medicamentos/categorias
Returns a deduplicated list of specialty names (not IDs) that have at least one active medication linked to them. This powers category filter UIs in medication browsers, letting patients or physicians narrow results to a specific discipline before applying further filters. Authentication: None (public)Array of specialty name strings (e.g.
["Cardiología", "Endocrinología", "Pediatría"]). Each value corresponds to the nombre field of a specialty that has at least one active medication linked via id_especialidad.GET /medicamentos/:id
Retrieves the full profile of a single active medication by its ID. Returns 404 if the medication does not exist or is inactive. Authentication: None (public)The medication’s unique identifier.
Medication identifier.
Commercial/brand name.
Generic active ingredient.
Manufacturing laboratory.
"OTC" or "Rx".Clinical description.
Clinical indications.
Contraindications.
Available forms and dosages.
INVIMA registration number.
Product image URL.
Linked specialty ID.
Active status (
true for all public responses).ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
POST /medicamentos
Creates a new medication entry in the catalog. The request body uses short field names (nombre, principio, presentacion) that the controller maps to the corresponding database column names. This route is exposed through the /medicamentos path and is also mirrored under /admin/medicamentos (with different field names — see the Admin API).
Authentication: None at route level (enforced at the admin layer)
The brand or commercial name of the medication. Stored as
nombre_comercial.Prescription classification. Must be exactly
"OTC" or "Rx".Active ingredient(s). Stored in both
principio_activo and principio_activa columns.Free-text description of the medication.
Physical form / presentations (e.g.
"Tabletas 500 mg"). Stored as presentaciones.Whether the medication is active in the catalog. Defaults to
true.Name of the pharmaceutical laboratory.
Optional link to a specialty ID (used for catalog filtering).
URL of the medication’s product image.
PUT /medicamentos/:id
Fully updates an existing medication record. Uses the same short field names asPOST /medicamentos. Setting activo=false removes the medication from all public-facing queries without deleting the record.
Authentication: None at route level (enforced at the admin layer)
The ID of the medication to update.
Updated commercial name. Stored as
nombre_comercial.Updated active ingredient. Stored as
principio_activo and principio_activa.Updated classification:
"OTC" or "Rx".Updated clinical description.
Updated presentation forms and dosages. Stored as
presentaciones.Set to
false to deactivate and hide from public listings.Updated laboratory name.
Updated specialty linkage.
Updated product image URL.