{"openapi":"3.1.0","info":{"title":"TECDEX Monitoring API","description":"REST API to manage monitors and read incidents and availability reports. Guide: https://monitoreo.tecdex.net/ayuda/api","version":"1.0.0"},"paths":{"/account":{"get":{"tags":["account"],"summary":"Account, plan and token","operationId":"cuenta_ver_account_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cuenta"}}}}},"security":[{"HTTPBearer":[]}]}},"/monitors":{"get":{"tags":["monitors"],"summary":"List monitors","operationId":"monitores_monitors_get","security":[{"HTTPBearer":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lista"}}}}}},"post":{"tags":["monitors"],"summary":"Create a monitor","operationId":"crear_monitors_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"idempotency-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional: retries with the same key (24 h) return the first result","title":"Idempotency-Key"},"description":"Optional: retries with the same key (24 h) return the first result"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorNuevo"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"403":{"description":"Monitor type not included in the plan (Free: http only)"},"409":{"description":"Plan limit reached"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/{monitor_id}":{"get":{"tags":["monitors"],"summary":"Get a monitor","operationId":"monitor_monitors__monitor_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["monitors"],"summary":"Update a monitor","operationId":"editar_monitors__monitor_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorCambio"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/{monitor_id}/pause":{"post":{"tags":["monitors"],"summary":"Pause a monitor (stops checks and alerts; nothing is deleted)","operationId":"pausar_monitors__monitor_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/{monitor_id}/resume":{"post":{"tags":["monitors"],"summary":"Resume a paused monitor","operationId":"reanudar_monitors__monitor_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"409":{"description":"Not paused, or plan limit reached"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/incidents":{"get":{"tags":["incidents"],"summary":"Incidents of the last N days (1-90)","operationId":"incidentes_incidents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Incidentes"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/{month}":{"get":{"tags":["reports"],"summary":"Monthly availability report (YYYY-MM)","operationId":"informe_reports__month__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"path","required":true,"schema":{"type":"string","title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Informe"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers":{"get":{"tags":["providers"],"summary":"List provider SLAs","operationId":"proveedores_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"items":{"$ref":"#/components/schemas/Proveedor"},"type":"array"},"type":"object","title":"Response Proveedores Providers Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["providers"],"summary":"Register a provider SLA","operationId":"proveedor_nuevo_providers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProveedorNuevo"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proveedor"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/{provider_id}":{"get":{"tags":["providers"],"summary":"Get a provider SLA","operationId":"proveedor_providers__provider_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"integer","title":"Provider Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proveedor"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/{provider_id}/reports/{month}":{"get":{"tags":["providers"],"summary":"Monthly breach report with credit due","operationId":"proveedor_reporte_providers__provider_id__reports__month__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"integer","title":"Provider Id"}},{"name":"month","in":"path","required":true,"schema":{"type":"string","title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReporteProveedor"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/{provider_id}/reports/{month}/evidence.{fmt}":{"get":{"tags":["providers"],"summary":"Evidence (pdf, csv, or zip with SHA256SUMS and manifest); SHA-256 in the X-Content-SHA256 header","operationId":"proveedor_evidencia_providers__provider_id__reports__month__evidence__fmt__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"integer","title":"Provider Id"}},{"name":"month","in":"path","required":true,"schema":{"type":"string","title":"Month"}},{"name":"fmt","in":"path","required":true,"schema":{"enum":["pdf","csv","zip"],"type":"string","title":"Fmt"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{},"text/csv":{},"application/zip":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Check":{"properties":{"name":{"type":"string","title":"Name"},"ok":{"type":"boolean","title":"Ok"},"pending":{"type":"boolean","title":"Pending","default":false},"cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cause"},"since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},"type":"object","required":["name","ok"],"title":"Check"},"Cuenta":{"properties":{"account":{"type":"string","title":"Account"},"plan":{"type":"string","title":"Plan"},"managed":{"type":"boolean","title":"Managed"},"monitors_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monitors Limit"},"intervals":{"items":{"type":"string"},"type":"array","title":"Intervals"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"token_name":{"type":"string","title":"Token Name"},"token_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Expires At"},"rate_limit_per_minute":{"type":"integer","title":"Rate Limit Per Minute"}},"type":"object","required":["account","plan","managed","monitors_limit","intervals","scopes","token_name","token_expires_at","rate_limit_per_minute"],"title":"Cuenta"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Incidente":{"properties":{"id":{"type":"string","title":"Id"},"monitor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Monitor Id"},"monitor_name":{"type":"string","title":"Monitor Name"},"summary":{"type":"string","title":"Summary"},"started_at":{"type":"string","title":"Started At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ended At"},"duration_s":{"type":"integer","title":"Duration S"},"ongoing":{"type":"boolean","title":"Ongoing"},"counts_for_sla":{"type":"boolean","title":"Counts For Sla"}},"type":"object","required":["id","monitor_id","monitor_name","summary","started_at","ended_at","duration_s","ongoing","counts_for_sla"],"title":"Incidente"},"Incidentes":{"properties":{"days":{"type":"integer","title":"Days"},"data":{"items":{"$ref":"#/components/schemas/Incidente"},"type":"array","title":"Data"}},"type":"object","required":["days","data"],"title":"Incidentes"},"Informe":{"properties":{"month":{"type":"string","title":"Month"},"partial":{"type":"boolean","title":"Partial"},"timezone":{"type":"string","title":"Timezone"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"generated_at":{"type":"string","title":"Generated At"},"slo_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Slo Pct"},"measurement_gaps_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Measurement Gaps S"},"systems":{"items":{"$ref":"#/components/schemas/SistemaInforme"},"type":"array","title":"Systems"}},"type":"object","required":["month","partial","timezone","period_start","period_end","generated_at","slo_pct","measurement_gaps_s","systems"],"title":"Informe"},"Lista":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Monitor"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"Lista"},"Monitor":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["http","tcp","ping","certificate","managed"],"title":"Type"},"status":{"type":"string","enum":["up","down","degraded","starting","unmeasurable","no_checks","paused"],"title":"Status"},"status_since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Since"},"paused_reason":{"anyOf":[{"type":"string","enum":["user","plan"]},{"type":"null"}],"title":"Paused Reason","description":"user: paused through the API or portal; plan: exceeds the plan"},"paused_since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused Since"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"expected_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Text"},"absent_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Absent Text"},"host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"},"port":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Port"},"interval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interval"},"warn_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Warn Days"},"checks":{"anyOf":[{"items":{"$ref":"#/components/schemas/Check"},"type":"array"},{"type":"null"}],"title":"Checks"}},"type":"object","required":["id","name","type","status"],"title":"Monitor"},"MonitorCambio":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":60,"minLength":2},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Url"},"expected_text":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Expected Text"},"absent_text":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Absent Text"},"host":{"anyOf":[{"type":"string","maxLength":253},{"type":"null"}],"title":"Host"},"port":{"anyOf":[{"type":"integer","maximum":65535.0,"minimum":1.0},{"type":"null"}],"title":"Port"},"interval":{"anyOf":[{"type":"string","enum":["30s","1m","5m"]},{"type":"null"}],"title":"Interval"},"warn_days":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Warn Days"}},"type":"object","title":"MonitorCambio"},"MonitorNuevo":{"properties":{"name":{"type":"string","maxLength":60,"minLength":2,"title":"Name","description":"Name shown in the portal and alerts"},"type":{"type":"string","enum":["http","tcp","ping","certificate"],"title":"Type"},"url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Url","description":"http: address to check (http/https, public)"},"expected_text":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Expected Text","description":"http: text that must appear in the page"},"absent_text":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Absent Text","description":"http: text that must NOT appear (e.g. Error); if it appears, the check fails"},"host":{"anyOf":[{"type":"string","maxLength":253},{"type":"null"}],"title":"Host","description":"tcp, ping, certificate: public hostname or IP"},"port":{"anyOf":[{"type":"integer","maximum":65535.0,"minimum":1.0},{"type":"null"}],"title":"Port","description":"tcp, certificate (default 443)"},"interval":{"anyOf":[{"type":"string","enum":["30s","1m","5m"]},{"type":"null"}],"title":"Interval","description":"Allowed values depend on the plan (default 5m)"},"warn_days":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Warn Days","description":"certificate: days before expiry to alert (default 14)"}},"type":"object","required":["name","type"],"title":"MonitorNuevo"},"Proveedor":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"service":{"type":"string","title":"Service"},"contract":{"type":"string","title":"Contract"},"monitor_ids":{"items":{"type":"string"},"type":"array","title":"Monitor Ids"},"slo_pct":{"type":"number","title":"Slo Pct"},"credit_tiers":{"items":{"$ref":"#/components/schemas/Tramo"},"type":"array","title":"Credit Tiers"},"monthly_fee":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Fee"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["id","name","service","contract","monitor_ids","slo_pct","credit_tiers","monthly_fee","currency","active"],"title":"Proveedor"},"ProveedorNuevo":{"properties":{"name":{"type":"string","maxLength":80,"minLength":2,"title":"Name","description":"Provider name"},"service":{"type":"string","maxLength":120,"title":"Service","default":""},"contract":{"type":"string","maxLength":120,"title":"Contract","description":"Contract or order reference","default":""},"monitor_ids":{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1,"title":"Monitor Ids","description":"Monitors of this account that measure the provider"},"slo_pct":{"type":"number","exclusiveMaximum":100.0,"minimum":50.0,"title":"Slo Pct","description":"Committed monthly availability, e.g. 99.9"},"credit_tiers":{"items":{"$ref":"#/components/schemas/Tramo"},"type":"array","title":"Credit Tiers"},"monthly_fee":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Monthly Fee"},"currency":{"anyOf":[{"type":"string","enum":["USD","CLP","BRL","EUR","UF"]},{"type":"null"}],"title":"Currency"},"notes":{"type":"string","maxLength":1000,"title":"Notes","default":""}},"type":"object","required":["name","monitor_ids","slo_pct"],"title":"ProveedorNuevo"},"ReporteProveedor":{"properties":{"provider_id":{"type":"integer","title":"Provider Id"},"month":{"type":"string","title":"Month"},"partial":{"type":"boolean","title":"Partial"},"timezone":{"type":"string","title":"Timezone"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"slo_pct":{"type":"number","title":"Slo Pct"},"availability_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Availability Pct"},"downtime_s":{"type":"integer","title":"Downtime S"},"measured_s":{"type":"integer","title":"Measured S"},"allowed_downtime_s":{"type":"number","title":"Allowed Downtime S"},"excess_s":{"type":"number","title":"Excess S"},"breached":{"type":"boolean","title":"Breached"},"credit_pct":{"type":"number","title":"Credit Pct"},"credit_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"excluded_maintenance_s":{"type":"integer","title":"Excluded Maintenance S"},"excluded_measurement_gaps_s":{"type":"integer","title":"Excluded Measurement Gaps S"},"incidents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Incidents"}},"type":"object","required":["provider_id","month","partial","timezone","period_start","period_end","slo_pct","availability_pct","downtime_s","measured_s","allowed_downtime_s","excess_s","breached","credit_pct","credit_amount","currency","excluded_maintenance_s","excluded_measurement_gaps_s","incidents"],"title":"ReporteProveedor"},"SistemaInforme":{"properties":{"monitor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Monitor Id"},"monitor_name":{"type":"string","title":"Monitor Name"},"availability_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Availability Pct"},"downtime_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Downtime S"},"measured_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Measured S"},"maintenance_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maintenance S"},"incidents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Incidents"},"mttr_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mttr S"},"mtbf_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mtbf S"},"paused_since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused Since"},"informative":{"type":"boolean","title":"Informative"}},"type":"object","required":["monitor_id","monitor_name","availability_pct","downtime_s","measured_s","maintenance_s","incidents","mttr_s","mtbf_s","paused_since","informative"],"title":"SistemaInforme"},"Tramo":{"properties":{"below_pct":{"type":"number","maximum":100.0,"exclusiveMinimum":0.0,"title":"Below Pct","description":"If availability falls below this %…"},"credit_pct":{"type":"number","maximum":100.0,"exclusiveMinimum":0.0,"title":"Credit Pct","description":"…this % of the monthly fee is credited"}},"type":"object","required":["below_pct","credit_pct"],"title":"Tramo"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"Account token (tdx_…), created by the account admin in the portal.","scheme":"bearer"}}},"tags":[{"name":"account"},{"name":"monitors"},{"name":"incidents"},{"name":"reports"},{"name":"providers"}],"servers":[{"url":"/api/v1"}]}