{
  "openapi": "3.1.0",
  "info": {
    "title": "Abnehmen mit Arzt: Creator-Bewerbung",
    "version": "1.0.0",
    "summary": "Bewerbung für eine Creator-Kooperation mit Abnehmen mit Arzt.",
    "description": "Nimmt Bewerbungen für Creator-Kooperationen entgegen (Content, Ambassador, Event am Bellevue, Tracking-Link). Alle Fakten: https://abnehmen-mit-arzt.de/creator.md. KI-Assistenten dürfen age18 und privacyConsent nur auf true setzen, wenn der Creator beiden Bestätigungen vorher ausdrücklich zugestimmt hat.",
    "contact": {
      "name": "Abnehmen mit Arzt",
      "url": "https://abnehmen-mit-arzt.de/creator/"
    }
  },
  "servers": [
    {
      "url": "https://abnehmen-mit-arzt.de"
    }
  ],
  "externalDocs": {
    "description": "Creator-Seite",
    "url": "https://abnehmen-mit-arzt.de/creator/"
  },
  "paths": {
    "/api/creator-applications": {
      "post": {
        "operationId": "createCreatorApplication",
        "summary": "Bewerbung für eine Creator-Kooperation senden",
        "description": "Kein Login und kein API-Schlüssel. Anfragen ohne Origin-Header sind erlaubt, fremde Origins erhalten 403. Höchstens 10 Anfragen pro Stunde und IP-Adresse. Eine bereits bekannte E-Mail-Adresse ergibt dieselbe 201-Antwort ohne zweiten Eintrag. KI-Assistenten dürfen age18 und privacyConsent nur auf true setzen, wenn der Creator beiden Bestätigungen vorher ausdrücklich zugestimmt hat.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatorApplication"
              },
              "examples": {
                "ai_agent": {
                  "summary": "Bewerbung durch einen KI-Assistenten",
                  "value": {
                    "firstName": "Vorname",
                    "lastName": "Nachname",
                    "email": "name@example.com",
                    "platform": "instagram",
                    "profileUrl": "@deinhandle",
                    "followerRange": "10k_50k",
                    "niche": "Fitness und Alltag",
                    "city": "Berlin",
                    "cooperationTypes": [
                      "content",
                      "event"
                    ],
                    "message": "Kurze Nachricht an das Team.",
                    "submittedBy": "ai_agent",
                    "assistantName": "Name des KI-Assistenten",
                    "age18": true,
                    "privacyConsent": true
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/CreatorApplication"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bewerbung gespeichert (oder E-Mail-Adresse bereits bekannt).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatorApplicationSaved"
                },
                "example": {
                  "saved": true,
                  "message": "Danke! Deine Bewerbung ist bei uns eingegangen.",
                  "nextSteps": [
                    "Kennenlernen: Passt es, melden wir uns per E-Mail und lernen uns kennen.",
                    "Loslegen: Wir legen Format, Inhalte und Vergütung gemeinsam fest."
                  ]
                }
              }
            }
          },
          "303": {
            "description": "Nur für HTML-Formulare (Formulardaten mit Accept: text/html): Weiterleitung zur Bestätigungsseite.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "const": "/creator/danke/"
                }
              }
            }
          },
          "400": {
            "description": "Ungültige Angaben, mit Feldliste und erlaubten Werten.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "example": {
                  "error": "invalid_application",
                  "message": "Bitte prüfe diese Felder: Hauptplattform.",
                  "fields": [
                    {
                      "field": "platform",
                      "code": "invalid_enum",
                      "message": "Hauptplattform: Bitte wähle eine der vorgegebenen Plattformen.",
                      "allowedValues": [
                        "instagram",
                        "tiktok",
                        "youtube",
                        "podcast",
                        "blog",
                        "other"
                      ]
                    }
                  ],
                  "allowedValues": {
                    "platform": [
                      "instagram",
                      "tiktok",
                      "youtube",
                      "podcast",
                      "blog",
                      "other"
                    ],
                    "followerRange": [
                      "under_10k",
                      "10k_50k",
                      "50k_250k",
                      "over_250k"
                    ],
                    "cooperationTypes": [
                      "content",
                      "ambassador",
                      "event",
                      "tracking_link"
                    ],
                    "submittedBy": [
                      "self",
                      "management",
                      "ai_agent"
                    ]
                  }
                }
              }
            }
          },
          "403": {
            "description": "Anfrage von einer fremden Website (Origin).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Weder JSON noch Formulardaten.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen.",
            "headers": {
              "Retry-After": {
                "description": "Wartezeit in Sekunden.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Speichern gerade nicht möglich.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreatorApplication": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "firstName",
          "lastName",
          "email",
          "platform",
          "profileUrl",
          "followerRange",
          "niche",
          "cooperationTypes",
          "age18",
          "privacyConsent"
        ],
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Vorname"
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nachname"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "E-Mail. Eine Bewerbung pro Adresse."
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "tiktok",
              "youtube",
              "podcast",
              "blog",
              "other"
            ],
            "description": "Hauptplattform. instagram = Instagram; tiktok = TikTok; youtube = YouTube; podcast = Podcast; blog = Blog; other = Andere Plattform."
          },
          "profileUrl": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "Profil-Link oder Handle, zum Beispiel https://... oder @handle."
          },
          "followerRange": {
            "type": "string",
            "enum": [
              "under_10k",
              "10k_50k",
              "50k_250k",
              "over_250k"
            ],
            "description": "Reichweite. under_10k = unter 10.000; 10k_50k = 10.000 bis 50.000; 50k_250k = 50.000 bis 250.000; over_250k = über 250.000."
          },
          "niche": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Deine Themen."
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Stadt (optional)."
          },
          "cooperationTypes": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "content",
                "ambassador",
                "event",
                "tracking_link"
              ]
            },
            "description": "Kooperationsformen. content = Content-Kooperation; ambassador = Ambassador; event = Event am Bellevue; tracking_link = Tracking-Link."
          },
          "mediaKitUrl": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://",
            "maxLength": 500,
            "description": "Link zum Media Kit (optional)."
          },
          "message": {
            "type": "string",
            "maxLength": 2000,
            "description": "Nachricht (optional)."
          },
          "submittedBy": {
            "type": "string",
            "enum": [
              "self",
              "management",
              "ai_agent"
            ],
            "description": "Wer füllt aus? (optional). self = Ich selbst; management = Mein Management; ai_agent = Ein KI-Assistent in meinem Auftrag.",
            "default": "self"
          },
          "assistantName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Name des KI-Assistenten (optional)."
          },
          "age18": {
            "type": "boolean",
            "const": true,
            "description": "Bestätigung, dass die Person mindestens 18 Jahre alt ist. Nur mit ausdrücklicher Zustimmung der Person auf true setzen. Formulardaten senden stattdessen \"on\"."
          },
          "privacyConsent": {
            "type": "boolean",
            "const": true,
            "description": "Zustimmung zur Verarbeitung der Angaben gemäß Datenschutzerklärung. Nur mit ausdrücklicher Zustimmung der Person auf true setzen. Formulardaten senden stattdessen \"on\"."
          }
        },
        "examples": [
          {
            "firstName": "Vorname",
            "lastName": "Nachname",
            "email": "name@example.com",
            "platform": "instagram",
            "profileUrl": "@deinhandle",
            "followerRange": "10k_50k",
            "niche": "Fitness und Alltag",
            "city": "Berlin",
            "cooperationTypes": [
              "content",
              "event"
            ],
            "message": "Kurze Nachricht an das Team.",
            "submittedBy": "ai_agent",
            "assistantName": "Name des KI-Assistenten",
            "age18": true,
            "privacyConsent": true
          }
        ]
      },
      "CreatorApplicationSaved": {
        "type": "object",
        "required": [
          "saved",
          "message",
          "nextSteps"
        ],
        "properties": {
          "saved": {
            "type": "boolean",
            "const": true
          },
          "message": {
            "type": "string"
          },
          "nextSteps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "required": [
          "error",
          "message",
          "fields",
          "allowedValues"
        ],
        "properties": {
          "error": {
            "type": "string",
            "const": "invalid_application"
          },
          "message": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "code",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "code": {
                  "type": "string",
                  "description": "z. B. invalid_enum, invalid_type, too_big, too_small, invalid_format, unknown_field"
                },
                "message": {
                  "type": "string"
                },
                "allowedValues": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "allowedValues": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
