{
  "openapi": "3.0.1",
  "info": {
    "title": "INVIMA Colombia — Sanitary Registry, Devices & Sanctions",
    "description": "Search, bulk-verify, and monitor 877,000+ official Colombia INVIMA sanitary registrations (CUM Medicines, Medical Devices, Food Establishments, BPM/HACCP Factories & Executed Sanctions) with expiry countdowns and automatic supplier sanctions cross-checks.",
    "version": "1.0",
    "x-build-id": "NVDQOM4orW8DhKXtU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/churches2908~colombia-invima-sanitary-registry/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-churches2908-colombia-invima-sanitary-registry",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/churches2908~colombia-invima-sanitary-registry/runs": {
      "post": {
        "operationId": "runs-sync-churches2908-colombia-invima-sanitary-registry",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/churches2908~colombia-invima-sanitary-registry/run-sync": {
      "post": {
        "operationId": "run-sync-churches2908-colombia-invima-sanitary-registry",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Operation Mode",
            "enum": [
              "search",
              "bulk_verify",
              "expiring_monitor",
              "sanctions_feed"
            ],
            "type": "string",
            "description": "Choose what workflow to run against official Colombia INVIMA open registries.",
            "default": "search"
          },
          "registries": {
            "title": "INVIMA Registries to Query (for search mode)",
            "type": "array",
            "description": "Select one or more official INVIMA datasets on datos.gov.co to query.",
            "items": {
              "type": "string",
              "enum": [
                "medicamentos_vigentes",
                "medicamentos_tramite",
                "medicamentos_vencidos",
                "medicamentos_otros",
                "dispositivos_medicos",
                "alimentos_establecimientos",
                "alimentos_bpm",
                "alimentos_haccp"
              ],
              "enumTitles": [
                "Medicines — Active (CUM Vigentes, 156K)",
                "Medicines — In Renewal (CUM En Trámite)",
                "Medicines — Expired (CUM Vencidos, 156K)",
                "Medicines — Other Statuses (Negado/Suspendido, 114K)",
                "Medical Devices & Diagnostics (Dispositivos Médicos, 436K)",
                "Monitored Food Establishments (Alimentos con NIT, 9.4K)",
                "BPM Certified Food Factories (Buenas Prácticas)",
                "HACCP Certified Food Factories"
              ]
            },
            "default": [
              "medicamentos_vigentes",
              "dispositivos_medicos"
            ]
          },
          "query": {
            "title": "Product / Keyword Search (Optional)",
            "type": "string",
            "description": "Search by product name, commercial description, or food line (e.g., 'IBUPROFENO', 'INSULINA', 'CATETER', 'LACTEOS'). Leave empty to retrieve the latest records."
          },
          "titular": {
            "title": "Company / Holder Name (Titular / Razón Social)",
            "type": "string",
            "description": "Filter by registration holder, manufacturer, food company, or sanctioned entity (e.g., 'PFIZER', 'TECNOQUIMICAS', 'BECTON')."
          },
          "activeIngredient": {
            "title": "Active Ingredient (Principio Activo — Medicines)",
            "type": "string",
            "description": "Filter CUM medication datasets by active pharmaceutical ingredient (e.g., 'ACETAMINOFEN', 'METFORMINA', 'LOSARTAN')."
          },
          "atcCode": {
            "title": "ATC Code (Medicines)",
            "type": "string",
            "description": "Filter by WHO Anatomical Therapeutic Chemical (ATC) prefix or exact code (e.g., 'M01AE01', 'C09')."
          },
          "nit": {
            "title": "Company Tax ID / NIT (Food & Sanctions)",
            "type": "string",
            "description": "Filter food establishments or INVIMA sanctions by Colombian NIT."
          },
          "department": {
            "title": "Department / City (Food Establishments & Factories)",
            "type": "string",
            "description": "Filter food registries by Colombian department or city (e.g., 'ANTIOQUIA', 'BOGOTA', 'VALLE', 'CUNDINAMARCA')."
          },
          "sanitaryStatus": {
            "title": "Sanitary Status Filter (Optional)",
            "type": "string",
            "description": "Filter medical devices or food establishments by status (e.g., 'Vigente', 'Vencido', 'Suspendido', 'Cancelado', 'FAVORABLE')."
          },
          "riskLevel": {
            "title": "Medical Device Risk Class (Optional)",
            "enum": [
              "ALL",
              "I",
              "IIA",
              "IIB",
              "III"
            ],
            "type": "string",
            "description": "Filter medical devices by INVIMA risk class.",
            "default": "ALL"
          },
          "registrationNumbers": {
            "title": "Registration Numbers (for bulk_verify mode)",
            "type": "array",
            "description": "List of up to 500 INVIMA sanitary registration codes to verify (e.g., ['INVIMA 2023M-0013598-R2', 'RIV2019-0000062']).",
            "items": {
              "type": "string"
            }
          },
          "expedientes": {
            "title": "Expediente Numbers (for bulk_verify mode)",
            "type": "array",
            "description": "List of numeric INVIMA expediente IDs to verify (e.g., ['20048021', '20165128']).",
            "items": {
              "type": "string"
            }
          },
          "expiringWithinDays": {
            "title": "Expiring Within Days (for expiring_monitor mode)",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "Return active medical device registrations and HACCP certifications expiring within the next N days (1 to 730).",
            "default": 90
          },
          "sanctionType": {
            "title": "Sanction Type Filter (for sanctions_feed mode)",
            "type": "string",
            "description": "Optional filter on sanction type (e.g., 'MULTA', 'AMONESTACION', 'DECOMISO', 'CIERRE')."
          },
          "quarter": {
            "title": "Quarter Filter (for sanctions_feed mode)",
            "type": "string",
            "description": "Optional quarter substring filter (e.g., '2026', 'JULIO-SEPTIEMBRE 2026')."
          },
          "deduplicateByRegistration": {
            "title": "Deduplicate by Sanitary Registration Code",
            "type": "boolean",
            "description": "When enabled, collapses multiple CUM commercial presentations of the same sanitary registration into a single representative record.",
            "default": true
          },
          "checkTitularSanctions": {
            "title": "Cross-Check Company Against INVIMA Sanctions",
            "type": "boolean",
            "description": "Automatically checks each registration holder/company against INVIMA's official executed sanctions database (rq4n-pzga) and attaches sanctions count & latest fine.",
            "default": true
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Maximum number of records to return across selected registries (1 to 25,000).",
            "default": 50
          },
          "socrataAppToken": {
            "title": "Socrata App Token (Optional)",
            "type": "string",
            "description": "Optional datos.gov.co Socrata App Token for very large extractions."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}