{
  "openapi": "3.1.0",
  "info": {
    "title": "Büro im Apollo – unverbindliche Anfragen",
    "version": "2.0.0",
    "description": "Submit an inquiry only, with the customer’s authorization. No booking, contract, payment, or activation. Always check GET /api/anfragen for submission_available before submitting."
  },
  "servers": [
    {
      "url": "./"
    }
  ],
  "paths": {
    "/api/anfragen": {
      "get": {
        "operationId": "getInquiryAvailability",
        "summary": "Check whether sending is configured",
        "responses": {
          "200": {
            "description": "submission_available reports runtime configuration. False means do not submit; use email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "submitApolloInquiry",
        "summary": "Send an authorized, non-binding inquiry to hello@buero-im-apollo.de",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InquiryRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/InquiryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resend accepted the inquiry, possibly as an identical retry. This is not a booking or proof of inbox delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "403": {
            "description": "Cross-site browser origin rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method; use GET or POST."
          },
          "409": {
            "description": "The ID was already used with different data. Do not create a new ID automatically; contact hello with the existing ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. Correct the named fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "502": {
            "description": "Sending is uncertain. Within 24 hours, retry only with the same ID and identical data, or contact hello. Never automatically create a fresh ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "503": {
            "description": "Mail transport not configured; contact hello directly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "InquiryRequest": {
        "type": "object",
        "required": ["produkt", "name", "email", "request_id"],
        "properties": {
          "produkt": {
            "type": "string",
            "enum": ["arbeitsplatz", "geschaeftsadresse"]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "firma": {
            "type": "string",
            "maxLength": 200
          },
          "taetigkeit": {
            "type": "string",
            "maxLength": 300
          },
          "start": {
            "type": "string",
            "description": "Optional. YYYY-MM-DD from today in Europe/Berlin; omit or use empty string for an open start.",
            "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
          },
          "nachricht": {
            "type": "string",
            "maxLength": 5000
          },
          "request_id": {
            "type": "string",
            "format": "uuid",
            "description": "Generate a UUID v4 per inquiry. Retry the identical payload with the same ID; deduplicated for 24 hours."
          },
          "linkedin": {
            "type": "string",
            "format": "uri",
            "maxLength": 500,
            "description": "Optional HTTPS LinkedIn person profile URL (linkedin.com/in/...). Omit or send empty string if unknown; never invent a profile."
          }
        },
        "example": {
          "produkt": "geschaeftsadresse",
          "name": "Beispielperson",
          "email": "person@example.invalid",
          "firma": "Beispielfirma",
          "start": "2026-11-01",
          "nachricht": "Bitte melden Sie sich zu den nächsten Schritten.",
          "request_id": "e511da34-86d4-4f44-a874-317b56af50b1"
        }
      },
      "InquiryResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": ["submitted"]
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "booking": {
            "type": "boolean",
            "enum": [false]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "AvailabilityResponse": {
        "type": "object",
        "properties": {
          "submission_available": {
            "type": "boolean"
          },
          "recipient": {
            "type": "string",
            "format": "email"
          },
          "booking": {
            "type": "boolean",
            "enum": [false]
          }
        }
      },
      "InquiryError": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "code": {
            "type": "string"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
