{
  "openapi": "3.1.0",
  "info": {
    "title": "WebDrift public API",
    "version": "1.0.0",
    "summary": "Book a call with WebDrift, send an enquiry or a project brief.",
    "description": "The public, unauthenticated endpoints behind the contact and booking forms of https://webdrift.io. The write endpoints (POST /api/booking, POST /api/lead) need a Cloudflare Turnstile token (header x-turnstile-token) and are for browsers only; without it they answer 403 turnstile_required. AI agents use the Model Context Protocol server at https://webdrift.io/mcp instead: its book_call and send_enquiry tools email the person a confirmation link, and the call is booked or the enquiry sent only after the person confirms. They send real data to a real team (booking confirmation and notification emails, a lead in the WebDrift CRM). A caller, human or agent, must only submit a person's data after that person has explicitly asked for it and agreed to the privacy policy (https://webdrift.io/datenschutz, English: https://webdrift.io/en/privacy). All rate limits are per client IP address and per 10 minutes, and the booking and lead endpoints additionally limit 5 requests per email address per 10 minutes. All responses are JSON with Cache-Control: no-store. There is no authentication, no API key and no OAuth: these endpoints only accept what the website forms accept. Request bodies must be application/json, at most 32 KB. The same booking and enquiry actions are also offered as a Model Context Protocol server (streamable HTTP, no authentication) at https://webdrift.io/mcp, described by https://webdrift.io/.well-known/mcp/server-card.json. That server also has search_knowledge, a read only search over the published website content (passages with their page URL, so answers stay grounded in the site).",
    "contact": {
      "name": "WebDrift",
      "url": "https://webdrift.io/en/contact",
      "email": "start@webdrift.io"
    },
    "termsOfService": "https://webdrift.io/en/terms",
    "x-llms-txt": "https://webdrift.io/llms.txt"
  },
  "externalDocs": {
    "description": "WebDrift facts for AI assistants (English)",
    "url": "https://webdrift.io/en/llm-info"
  },
  "servers": [
    {
      "url": "https://webdrift.io",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "booking",
      "description": "Book or cancel a free 30 minute call."
    },
    {
      "name": "enquiry",
      "description": "Send a contact message or a project brief."
    },
    {
      "name": "status",
      "description": "Liveness."
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "status"
        ],
        "summary": "Liveness check",
        "description": "Cheap liveness probe: no database access, no rate limit.",
        "responses": {
          "200": {
            "description": "The service is up.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                },
                "example": {
                  "ok": true
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/slots": {
      "get": {
        "operationId": "listBookingSlots",
        "tags": [
          "booking"
        ],
        "summary": "List free call slots",
        "description": "Returns the bookable 30 minute slots according to WebDrift's availability rules (Europe/Berlin), already minus existing bookings and blocked days. Rate limit: 60 requests per 10 minutes per IP.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First day to list, YYYY-MM-DD (a calendar day in Europe/Berlin). Default: today (UTC date).",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "examples": [
                "2026-10-05"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Number of days to list, 1 to 31. Default 14.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 31,
              "default": 14
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Free slots. The slots array can be empty.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "tz",
                    "durationMin",
                    "slots"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "tz": {
                      "const": "Europe/Berlin"
                    },
                    "durationMin": {
                      "const": 30
                    },
                    "slots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "start",
                          "end"
                        ],
                        "properties": {
                          "start": {
                            "type": "string",
                            "format": "date-time",
                            "description": "UTC instant, ISO 8601 with milliseconds and Z. Use this exact string as `slot` when booking."
                          },
                          "end": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "tz": "Europe/Berlin",
                  "durationMin": 30,
                  "slots": [
                    {
                      "start": "2026-10-05T07:00:00.000Z",
                      "end": "2026-10-05T07:30:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "An Origin header was sent and it is not https://webdrift.io. Requests without an Origin header (non browser clients) are accepted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "forbidden"
                }
              }
            }
          },
          "422": {
            "description": "`from` is not a valid day or `days` is not an integer from 1 to 31.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached (see the limits in the operation description). Wait and retry later.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "rate_limited"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Nothing was stored or confirmed; retry later or write to start@webdrift.io.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "server_error"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "server_error"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking": {
      "post": {
        "operationId": "createBooking",
        "tags": [
          "booking"
        ],
        "summary": "Book a free 30 minute call",
        "description": "Browser only: requires a Cloudflare Turnstile token in the `x-turnstile-token` header, which only a browser showing the form on https://webdrift.io can obtain. AI agents and other non browser clients cannot use this endpoint: use the MCP server at https://webdrift.io/mcp instead (tools list_call_slots, book_call, send_enquiry), where a write takes effect only after the person confirms it by email. Books one slot returned by listBookingSlots. WebDrift then sends a confirmation email with a calendar invite and a cancellation link to `email` and a notification to the team. The API has no consent field because the website form enforces the privacy consent checkbox itself: a caller acting for a person must obtain that person's consent first. Rate limit: 5 requests per 10 minutes per IP and 5 per email address.",
        "parameters": [
          {
            "name": "x-turnstile-token",
            "in": "header",
            "required": true,
            "description": "Cloudflare Turnstile token of the website form (browser only). Missing: 403 turnstile_required. Invalid or reused: 403 turnstile_failed.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "slot",
                  "lang"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 160
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 320,
                    "description": "A valid email address (local@domain.tld). Stored lower case. The confirmation goes here."
                  },
                  "slot": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                    "description": "A `start` value from listBookingSlots, copied exactly. Slots can be taken meanwhile (409)."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ],
                    "description": "Language of the confirmation email and the call."
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Optional."
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Optional topic or question for the call."
                  },
                  "startedAt": {
                    "type": "number",
                    "description": "Optional for this endpoint. Unix time in milliseconds when the person started filling in the form. A value younger than 3 seconds is treated as a bot: the API answers 200 {\"ok\":true} without a `booking` and books nothing.",
                    "examples": [
                      1767225600000
                    ]
                  },
                  "company_website": {
                    "type": "string",
                    "maxLength": 0,
                    "description": "Honeypot. Leave this field out or send an empty string. Any non empty value is treated as a bot: the API answers 200 {\"ok\":true} but stores and sends nothing."
                  }
                }
              },
              "example": {
                "name": "Max Mustermann",
                "email": "max@example.com",
                "slot": "2026-10-05T07:00:00.000Z",
                "lang": "en",
                "note": "New website for my company"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Booked. If `booking` is missing the request was dropped as a bot (honeypot or time trap) and nothing was booked.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "booking": {
                      "type": "object",
                      "required": [
                        "id",
                        "start",
                        "end",
                        "tz"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "start": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "end": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "tz": {
                          "const": "Europe/Berlin"
                        }
                      }
                    },
                    "mail": {
                      "const": "failed",
                      "description": "The booking is stored but at least one of the emails could not be sent."
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "booking": {
                    "id": "01JABCDEF",
                    "start": "2026-10-05T07:00:00.000Z",
                    "end": "2026-10-05T07:30:00.000Z",
                    "tz": "Europe/Berlin"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body is not valid JSON, not application/json or larger than 32 KB.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid"
                }
              }
            }
          },
          "403": {
            "description": "turnstile_required: no Turnstile token (every non browser client). turnstile_failed: the token is invalid or was already used. forbidden: an Origin header was sent and it is not https://webdrift.io. Agents: use the MCP server at https://webdrift.io/mcp.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "turnstile_required",
                        "turnstile_failed",
                        "forbidden"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "turnstile_required"
                }
              }
            }
          },
          "409": {
            "description": "The slot is no longer free. List the slots again and pick another one.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "slot_taken"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "slot_taken"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or malformed, or the slot is not a bookable instant.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached (see the limits in the operation description). Wait and retry later.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "rate_limited"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Nothing was stored or confirmed; retry later or write to start@webdrift.io.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "server_error"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "server_error"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/cancel": {
      "post": {
        "operationId": "cancelBooking",
        "tags": [
          "booking"
        ],
        "summary": "Cancel a booked call",
        "description": "Cancels a booking with the secret token from the cancellation link in the confirmation email (the link looks like https://webdrift.io/api/booking/cancel?token=...). The token is only known to the person who booked: a booking cannot be cancelled without it. A used or unknown token returns 410. Rate limit: 5 requests per 10 minutes per IP.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 100,
                    "pattern": "^[A-Za-z0-9_-]{20,100}$"
                  }
                }
              },
              "example": {
                "token": "TOKEN_FROM_THE_CONFIRMATION_EMAIL"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancelled. A cancellation email with a calendar update is sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                },
                "example": {
                  "ok": true
                }
              }
            }
          },
          "400": {
            "description": "Body is not valid JSON or not application/json.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid"
                }
              }
            }
          },
          "403": {
            "description": "An Origin header was sent and it is not https://webdrift.io. Requests without an Origin header (non browser clients) are accepted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "forbidden"
                }
              }
            }
          },
          "410": {
            "description": "The token is unknown or the booking is already cancelled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid"
                }
              }
            }
          },
          "422": {
            "description": "The token does not have the expected format.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached (see the limits in the operation description). Wait and retry later.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "rate_limited"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Nothing was stored or confirmed; retry later or write to start@webdrift.io.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "server_error"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "server_error"
                }
              }
            }
          }
        }
      }
    },
    "/api/lead": {
      "post": {
        "operationId": "createLead",
        "tags": [
          "enquiry"
        ],
        "summary": "Send a contact message or a project brief",
        "description": "Browser only: requires a Cloudflare Turnstile token in the `x-turnstile-token` header, which only a browser showing the form on https://webdrift.io can obtain. AI agents and other non browser clients cannot use this endpoint: use the MCP server at https://webdrift.io/mcp instead (tools list_call_slots, book_call, send_enquiry), where a write takes effect only after the person confirms it by email. Creates a lead in the WebDrift CRM and sends a confirmation email to `email` plus a notification to the team. `type` selects the shape: `contact` (a short message) or `brief` (the structured project brief of https://webdrift.io/projekt-starten). `consent` must be literally true and may only be sent after the person agreed to the privacy policy. Rate limit: 5 requests per 10 minutes per IP (shared with the brief form) and 5 per email address.",
        "parameters": [
          {
            "name": "x-turnstile-token",
            "in": "header",
            "required": true,
            "description": "Cloudflare Turnstile token of the website form (browser only). Missing: 403 turnstile_required. Invalid or reused: 403 turnstile_failed.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ContactLead"
                  },
                  {
                    "$ref": "#/components/schemas/BriefLead"
                  }
                ],
                "discriminator": {
                  "propertyName": "type"
                }
              },
              "examples": {
                "contact": {
                  "summary": "Contact message",
                  "value": {
                    "type": "contact",
                    "lang": "en",
                    "name": "Max Mustermann",
                    "email": "max@example.com",
                    "message": "I would like a quote for a new website.",
                    "consent": true,
                    "startedAt": 1767225600000,
                    "path": "/en/contact"
                  }
                },
                "brief": {
                  "summary": "Project brief",
                  "value": {
                    "type": "brief",
                    "locale": "en",
                    "services": [
                      "website"
                    ],
                    "description": "Relaunch of our company website with a booking form.",
                    "budget": "3-5k",
                    "timeline": "1-3m",
                    "name": "Max Mustermann",
                    "email": "max@example.com",
                    "consent": true,
                    "startedAt": 1767225600000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored. `id` is the lead id. If `id` is missing the request was dropped as a bot (honeypot or time trap) and nothing was stored. `mail` is only present when the notification or confirmation email could not be sent (the lead is stored anyway).",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "id": {
                      "type": "string"
                    },
                    "mail": {
                      "type": "string",
                      "enum": [
                        "failed",
                        "skipped"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "id": "01JABCDEF"
                }
              }
            }
          },
          "400": {
            "description": "Body is not valid JSON, not application/json or larger than 32 KB.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid"
                }
              }
            }
          },
          "403": {
            "description": "turnstile_required: no Turnstile token (every non browser client). turnstile_failed: the token is invalid or was already used. forbidden: an Origin header was sent and it is not https://webdrift.io. Agents: use the MCP server at https://webdrift.io/mcp.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "turnstile_required",
                        "turnstile_failed",
                        "forbidden"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "turnstile_required"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. `fields` names every invalid or missing property.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "invalid"
                      ]
                    },
                    "fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "invalid",
                  "fields": [
                    "email",
                    "consent"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached (see the limits in the operation description). Wait and retry later.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "rate_limited"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Nothing was stored or confirmed; retry later or write to start@webdrift.io.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reason"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "server_error"
                      ]
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "reason": "server_error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactLead": {
        "type": "object",
        "title": "Contact message",
        "required": [
          "type",
          "lang",
          "name",
          "email",
          "consent",
          "startedAt"
        ],
        "properties": {
          "type": {
            "const": "contact"
          },
          "lang": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "maxLength": 254
          },
          "phone": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^[0-9+()\\-./\\s]{4,40}$",
            "description": "Optional. Digits and + ( ) - . / only."
          },
          "company": {
            "type": "string",
            "maxLength": 160,
            "description": "Optional."
          },
          "service": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional topic, free text (for example the service name)."
          },
          "message": {
            "type": "string",
            "maxLength": 3000,
            "description": "The message. Optional for the API, but an enquiry without a message is not useful."
          },
          "path": {
            "type": "string",
            "maxLength": 500,
            "pattern": "^/",
            "description": "Optional page path the enquiry came from, for example /en/contact."
          },
          "consent": {
            "const": true,
            "description": "The person agreed to the privacy policy. Must be the boolean true."
          },
          "startedAt": {
            "type": "number",
            "description": "Time trap. Unix time in milliseconds when the person started filling in the form. Must be at least 3 seconds in the past, at most 3 days in the past and not in the future (60 s clock skew allowed). A value younger than 3 seconds is treated as a bot: the API answers 200 {\"ok\":true} but stores and sends nothing.",
            "examples": [
              1767225600000
            ]
          },
          "company_website": {
            "type": "string",
            "maxLength": 0,
            "description": "Honeypot. Leave this field out or send an empty string. Any non empty value is treated as a bot: the API answers 200 {\"ok\":true} but stores and sends nothing."
          }
        }
      },
      "BriefLead": {
        "type": "object",
        "title": "Project brief",
        "required": [
          "type",
          "services",
          "description",
          "name",
          "email",
          "budget",
          "timeline",
          "consent",
          "startedAt"
        ],
        "properties": {
          "type": {
            "const": "brief"
          },
          "locale": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ],
            "description": "Language of the confirmation email. `lang` is accepted as an alias. Default de."
          },
          "lang": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ],
            "description": "Alias of `locale`."
          },
          "services": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "website",
                "shop",
                "system",
                "ai",
                "branding",
                "design",
                "marketing",
                "visibility",
                "partnership"
              ]
            },
            "description": "website, shop, system (business system / CRM), ai (AI and automation), branding, design (graphic design), marketing (marketing and SEO), visibility (AI visibility), partnership."
          },
          "situation": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^[A-Za-z0-9+\\-_.]{1,40}$",
            "examples": [
              "new",
              "relaunch",
              "extend"
            ],
            "description": "Optional. Ids used by the website form: new, relaunch, extend."
          },
          "goals": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 40,
              "pattern": "^[A-Za-z0-9+\\-_.]{1,40}$"
            },
            "examples": [
              [
                "leads",
                "visibility"
              ]
            ],
            "description": "Optional ids. Used by the website form: leads, sales, time, brand, visibility, modern, recruiting, overview."
          },
          "features": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 40,
              "pattern": "^[A-Za-z0-9+\\-_.]{1,40}$"
            },
            "examples": [
              [
                "contact",
                "booking",
                "cms"
              ]
            ],
            "description": "Optional ids. Used by the website form: contact, booking, multilang, blog, cms, payment, portal, crm, newsletter, chatbot, analytics, seo."
          },
          "url": {
            "type": "string",
            "maxLength": 300,
            "description": "Optional existing website, with or without https://."
          },
          "description": {
            "type": "string",
            "minLength": 20,
            "maxLength": 4000,
            "description": "What the project is about."
          },
          "budget": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^[A-Za-z0-9+\\-_.]{1,40}$",
            "examples": [
              "1-3k",
              "3-5k",
              "5-10k",
              "10-25k",
              "25k+",
              "unsure"
            ],
            "description": "Id used by the website form: 1-3k, 3-5k, 5-10k, 10-25k, 25k+, unsure (euro ranges)."
          },
          "timeline": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^[A-Za-z0-9+\\-_.]{1,40}$",
            "examples": [
              "asap",
              "1-3m",
              "3-6m",
              "flex"
            ],
            "description": "Id used by the website form: asap, 1-3m, 3-6m, flex."
          },
          "slots": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 40,
              "pattern": "^[A-Za-z0-9+\\-_.]{1,40}$"
            },
            "examples": [
              [
                "9-11",
                "14-16"
              ]
            ],
            "description": "Optional preferred times to be reached. Used by the website form: 9-11, 11-13, 14-16, 16-18, flex."
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "company": {
            "type": "string",
            "maxLength": 160,
            "description": "Optional."
          },
          "email": {
            "type": "string",
            "maxLength": 254
          },
          "phone": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^[0-9+()\\-./\\s]{4,40}$",
            "description": "Optional."
          },
          "message": {
            "type": "string",
            "maxLength": 3000,
            "description": "Optional additional message."
          },
          "consent": {
            "const": true,
            "description": "The person agreed to the privacy policy. Must be the boolean true."
          },
          "startedAt": {
            "type": "number",
            "description": "Time trap. Unix time in milliseconds when the person started filling in the form. Must be at least 3 seconds in the past, at most 3 days in the past and not in the future (60 s clock skew allowed). A value younger than 3 seconds is treated as a bot: the API answers 200 {\"ok\":true} but stores and sends nothing.",
            "examples": [
              1767225600000
            ]
          },
          "company_website": {
            "type": "string",
            "maxLength": 0,
            "description": "Honeypot. Leave this field out or send an empty string. Any non empty value is treated as a bot: the API answers 200 {\"ok\":true} but stores and sends nothing."
          }
        }
      }
    }
  }
}
