{
  "openapi": "3.1.0",
  "info": {
    "title": "COL0 public API",
    "version": "1.0.0",
    "description": "COL0 (Adbeel SAS) is an IoT / telecom software development company. This API is intentionally small: two write-only endpoints behind the public marketing site at https://col0.com, used to submit the contact form and to request the free lead-magnet resource. There is no read/query API and no authentication — both endpoints are rate-limited per IP and protected by Cloudflare Turnstile. Versioning: every /api/* response carries an API-Version header (current: 1). Breaking changes bump that version, and deprecations are announced with a Sunset header at least 90 days in advance.",
    "contact": {
      "name": "COL0 / Adbeel SAS",
      "email": "info@col0.com",
      "url": "https://col0.com"
    }
  },
  "externalDocs": {
    "description": "COL0 API documentation",
    "url": "https://col0.com/docs/"
  },
  "x-api-versioning": {
    "header": "API-Version",
    "current": "1",
    "deprecationHeaders": [
      "Deprecation",
      "Sunset"
    ],
    "minimumNoticeDays": 90
  },
  "servers": [
    {
      "url": "https://col0.com"
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "API index: current version, documentation URL and endpoints",
        "responses": {
          "200": {
            "description": "API index.",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            }
          },
          "429": {
            "description": "Error. `error` is one of: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "submitContactForm",
        "summary": "Submit the contact form",
        "description": "Sends a message to the COL0 sales team via email (Resend). Requires a solved Cloudflare Turnstile challenge and a same-origin Origin/Referer header, so it cannot be called directly by third-party agents or scripts outside col0.com — use it only when acting on behalf of a user filling out the form on the site itself.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent.",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error. `error` is one of: invalid_body | missing_captcha | missing_fields | invalid_email | too_long | consent_required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error. `error` is one of: forbidden_origin | captcha_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Error. `error` is one of: method_not_allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error. `error` is one of: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error. `error` is one of: misconfigured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Error. `error` is one of: send_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/lead-magnet": {
      "post": {
        "operationId": "requestLeadMagnet",
        "summary": "Request a free downloadable resource by email",
        "description": "Captures an email address in exchange for a resource (currently \"guia-iot-colombia\") and emails the requester the link. Requires a solved Cloudflare Turnstile challenge and a same-origin Origin/Referer header, so it cannot be called directly by third-party agents or scripts outside col0.com.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadMagnetRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/LeadMagnetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead captured; resource link emailed to the requester.",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "description": "Public URL of the resource."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error. `error` is one of: invalid_body | missing_captcha | invalid_email | too_long | consent_required | unknown_resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error. `error` is one of: forbidden_origin | captcha_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Error. `error` is one of: method_not_allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error. `error` is one of: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error. `error` is one of: misconfigured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Error. `error` is one of: send_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "RateLimitPolicy": {
        "description": "draft-ietf-httpapi-ratelimit-headers style rate-limit policy (also sent: RateLimit-Limit).",
        "schema": {
          "type": "string",
          "example": "20;w=60"
        }
      },
      "Deprecation": {
        "description": "Sent only once an endpoint is deprecated (RFC 9745).",
        "schema": {
          "type": "string"
        }
      },
      "Sunset": {
        "description": "Removal date of a deprecated endpoint (RFC 8594), at least 90 days ahead.",
        "schema": {
          "type": "string"
        }
      },
      "ApiVersion": {
        "description": "Current API version.",
        "schema": {
          "type": "string",
          "example": "1"
        }
      }
    },
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "message",
          "consent",
          "cf-turnstile-response"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "company": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "projectType": {
            "type": "string",
            "enum": [
              "iot",
              "monitoring",
              "analytics",
              "ai",
              "telecom",
              "connectivity",
              "whatsapp",
              "custom",
              "other"
            ]
          },
          "message": {
            "type": "string",
            "maxLength": 5000
          },
          "consent": {
            "type": "string",
            "description": "Truthy value confirming Habeas Data consent (Colombian Law 1581/2012)."
          },
          "cf-turnstile-response": {
            "type": "string",
            "description": "Token from a solved Cloudflare Turnstile challenge."
          }
        }
      },
      "LeadMagnetRequest": {
        "type": "object",
        "required": [
          "email",
          "resource",
          "consent",
          "cf-turnstile-response"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 200
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "resource": {
            "type": "string",
            "enum": [
              "guia-iot-colombia"
            ],
            "description": "Id of the resource requested."
          },
          "locale": {
            "type": "string",
            "enum": [
              "es",
              "en",
              "pt-br"
            ],
            "default": "es"
          },
          "consent": {
            "type": "string",
            "description": "Truthy value confirming Habeas Data consent (Colombian Law 1581/2012)."
          },
          "cf-turnstile-response": {
            "type": "string",
            "description": "Token from a solved Cloudflare Turnstile challenge."
          }
        }
      },
      "SuccessResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "ok",
          "error",
          "message",
          "resolution"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string",
            "description": "Stable machine-readable error code."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation of what went wrong."
          },
          "resolution": {
            "type": "string",
            "description": "What the caller should do about it."
          }
        }
      }
    }
  }
}