# POST /v2/auth/forgot_password/change_request

Neues Passwort über Rücksetzlink speichern

Prüft den unverbrauchten data.code und das neue data.password gegen die Passwortregeln. Speichert den Passwort-Hash des zugehörigen Administrators und verbraucht den Rücksetzcode. Es erfolgt kein automatischer Login.

- Operation-ID: post_v2_auth_forgot_password_change_request
- Dokumentation: /docs/api/v2/operations/post-v2-auth-forgot-password-change-request-b4b002069949/
- OpenAPI-Version: 3.2.1
- Vollständige Spezifikation: /docs/api/v2/openapi.json
- Dokumentationsstatus: reviewed
- Ändert Zustand: ja
- Für Automation freigegeben: nein

## Server

Serverwerte stammen unverändert aus der Datei. Eine lokale Entwicklungsadresse ist keine bestätigte Produktionsadresse. `API_ORIGIN` muss auf die passende Instanz gesetzt werden.

```json
[
  {
    "url": "https://app2.edoobox.com",
    "description": "edoobox API"
  }
]
```

## Authentifizierung

Für diesen Endpunkt deklariert die Spezifikation keine OpenAPI-Authentifizierung (`security: []`). Weitere Bedingungen stehen in der Beschreibung und den edoobox-Hinweisen.

### Wirksame Security Requirements und vollständige Verfahren

```json
{
  "security": [],
  "securitySchemes": {}
}
```

## Parameter

Keine Parameter deklariert.

### Vollständige wirksame Parameterdefinitionen

```json
[]
```

## Anfrage

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "writeOnly": true,
                "x-edoobox-sensitive": true,
                "description": "Nur synthetisches Beispiel; tatsächlich zurückgegebenes geschütztes Material sicher übergeben.",
                "minLength": 100,
                "maxLength": 150
              },
              "password": {
                "type": "string",
                "writeOnly": true,
                "x-edoobox-sensitive": true,
                "description": "Neues Passwort: mindestens acht Zeichen mit Klein-/Großbuchstaben, Ziffer und unterstütztem Sonderzeichen; Trivialpasswortliste wird geprüft. Der Server trimmt das Passwort.",
                "minLength": 8
              }
            },
            "additionalProperties": true,
            "required": [
              "code",
              "password"
            ]
          }
        },
        "additionalProperties": true,
        "required": [
          "data"
        ]
      },
      "example": {
        "data": {
          "code": "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr",
          "password": "Synthetic-Reset-Password-42!"
        }
      }
    },
    "application/x-www-form-urlencoded": {
      "schema": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "writeOnly": true,
            "x-edoobox-sensitive": true,
            "description": "Nur synthetisches Beispiel; tatsächlich zurückgegebenes geschütztes Material sicher übergeben.",
            "minLength": 100,
            "maxLength": 150
          },
          "password": {
            "type": "string",
            "writeOnly": true,
            "x-edoobox-sensitive": true,
            "description": "Neues Passwort: mindestens acht Zeichen mit Klein-/Großbuchstaben, Ziffer und unterstütztem Sonderzeichen; Trivialpasswortliste wird geprüft. Der Server trimmt das Passwort.",
            "minLength": 8
          }
        },
        "additionalProperties": true,
        "required": [
          "code",
          "password"
        ]
      },
      "example": {
        "code": "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr",
        "password": "Synthetic-Reset-Password-42!"
      }
    }
  }
}
```

## Antworten

HTTP-Status und Antwortinhalt gemeinsam auswerten. Die folgenden Beschreibungen und Schemata sind die Angaben der Quelldatei.

```json
{
  "200": {
    "description": "valid=true und message=password_changed nach erfolgreicher Änderung.",
    "content": {
      "application/json": {
        "example": {
          "success": true,
          "error": false,
          "data": {
            "valid": true,
            "message": "password_changed"
          }
        },
        "schema": {
          "type": "object",
          "properties": {
            "success": {
              "type": "boolean"
            },
            "error": {
              "type": [
                "boolean",
                "string"
              ]
            },
            "error_code": {
              "type": "string"
            },
            "data": {
              "type": "object",
              "properties": {
                "valid": {
                  "type": "boolean"
                },
                "message": {
                  "const": "password_changed"
                }
              },
              "additionalProperties": true,
              "required": [
                "valid",
                "message"
              ]
            },
            "type": {
              "type": "string"
            }
          },
          "additionalProperties": true
        }
      }
    }
  },
  "400": {
    "description": "Invalid request.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40006"
        }
      }
    }
  },
  "401": {
    "description": "Missing/expired token, missing account context, account paused or model-specific authorization failure.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40103"
        }
      }
    }
  },
  "402": {
    "description": "Missing/invalid action data or subscription/operation restriction.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80100"
        }
      }
    }
  },
  "403": {
    "description": "Permission denied. Browser CORS rejection may have an empty body.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40340"
        }
      }
    }
  },
  "404": {
    "description": "Unknown resource/action or unsupported method.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80019"
        }
      }
    }
  },
  "422": {
    "description": "Validation failed.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80020"
        }
      }
    }
  },
  "429": {
    "description": "Request/login rate limit exceeded. Honor Retry-After when supplied; legacy rate-limit paths may omit it. Retry only proven reads within a bounded deadline; a mutation is never automatically replayed after an ambiguous response.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED42902"
        }
      }
    },
    "headers": {
      "Retry-After": {
        "description": "Optional server delay in whole seconds or an HTTP date. Absence is not permission for an immediate retry.",
        "schema": {
          "type": "string",
          "examples": [
            "30"
          ]
        }
      }
    }
  },
  "502": {
    "description": "Server-side operation failed.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED50201"
        }
      }
    }
  }
}
```

## Aufrufbeispiele

Anpassen vor dem Ausführen. Platzhalter und veröffentlichte Beispiele sind synthetisch. Die Beispiele senden hier keine Anfrage; sie ergänzen keine unbekannten Pflichtfelder.

### cURL

```sh
# Request Body: synthetisches Beispiel aus der Spezifikation; Werte und Vollständigkeit vor Verwendung prüfen.
: "${API_ORIGIN:?API_ORIGIN setzen}"
cat > payload.json <<'EDOOBOX_JSON_EXAMPLE'
{
  "data": {
    "code": "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr",
    "password": "Synthetic-Reset-Password-42!"
  }
}
EDOOBOX_JSON_EXAMPLE
curl --request 'POST' \
  --url "${API_ORIGIN%/}"'/v2/auth/forgot_password/change_request' \
  --header 'Content-Type: application/json' \
  --data-binary '@payload.json'
```

### JavaScript (Node.js)

```javascript
// Request Body: synthetisches Beispiel aus der Spezifikation; Werte und Vollständigkeit vor Verwendung prüfen.
const required = (name) => {
  const value = process.env[name];
  if (!value) throw new Error(`Set ${name}`);
  return value;
};
let path = "/v2/auth/forgot_password/change_request";
const origin = required('API_ORIGIN');
const url = new URL((origin.endsWith('/') ? origin.slice(0, -1) : origin) + path);
const headers = {};
headers['Content-Type'] = "application/json";
const body = JSON.stringify({
  "data": {
    "code": "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr",
    "password": "Synthetic-Reset-Password-42!"
  }
});
const response = await fetch(url, { method: "POST", headers, body, redirect: 'manual' });
const text = await response.text();
console.log(response.status, text);
// HTTP-Status und dokumentierte error/success-Felder gemeinsam prüfen.
```

### Python

```python
# Request Body: synthetisches Beispiel aus der Spezifikation; Werte und Vollständigkeit vor Verwendung prüfen.
import os
import urllib.parse
import urllib.request
import urllib.error

path = "/v2/auth/forgot_password/change_request"
url = os.environ["API_ORIGIN"].rstrip("/") + path
headers = {}
headers["Content-Type"] = "application/json"
body = "{\"data\":{\"code\":\"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr\",\"password\":\"Synthetic-Reset-Password-42!\"}}".encode("utf-8")

# Redirects nicht automatisch verfolgen.
class NoRedirect(urllib.request.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        return None
request = urllib.request.Request(url, headers=headers, method="POST", data=body)
try:
    response = urllib.request.build_opener(NoRedirect).open(request, timeout=30)
except urllib.error.HTTPError as error:
    response = error
print(response.status, response.read().decode("utf-8", errors="replace"))
# HTTP-Status und dokumentierte error/success-Felder gemeinsam prüfen.
```

## Vollständige Operationsdefinition und edoobox-Hinweise

Alle Originalfelder einschliesslich `x-edoobox-*`, requestBody und responses bleiben erhalten. Teilweise dokumentierte Schemata sind kein vollständiger Validierungsvertrag.

```json
{
  "operationId": "post_v2_auth_forgot_password_change_request",
  "summary": "Neues Passwort über Rücksetzlink speichern",
  "description": "Prüft den unverbrauchten data.code und das neue data.password gegen die Passwortregeln. Speichert den Passwort-Hash des zugehörigen Administrators und verbraucht den Rücksetzcode. Es erfolgt kein automatischer Login.",
  "tags": [
    "auth"
  ],
  "security": [],
  "parameters": [],
  "responses": {
    "200": {
      "description": "valid=true und message=password_changed nach erfolgreicher Änderung.",
      "content": {
        "application/json": {
          "example": {
            "success": true,
            "error": false,
            "data": {
              "valid": true,
              "message": "password_changed"
            }
          },
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "error": {
                "type": [
                  "boolean",
                  "string"
                ]
              },
              "error_code": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "properties": {
                  "valid": {
                    "type": "boolean"
                  },
                  "message": {
                    "const": "password_changed"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "valid",
                  "message"
                ]
              },
              "type": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        }
      }
    },
    "400": {
      "description": "Invalid request.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40006"
          }
        }
      }
    },
    "401": {
      "description": "Missing/expired token, missing account context, account paused or model-specific authorization failure.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40103"
          }
        }
      }
    },
    "402": {
      "description": "Missing/invalid action data or subscription/operation restriction.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80100"
          }
        }
      }
    },
    "403": {
      "description": "Permission denied. Browser CORS rejection may have an empty body.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40340"
          }
        }
      }
    },
    "404": {
      "description": "Unknown resource/action or unsupported method.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80019"
          }
        }
      }
    },
    "422": {
      "description": "Validation failed.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80020"
          }
        }
      }
    },
    "429": {
      "description": "Request/login rate limit exceeded. Honor Retry-After when supplied; legacy rate-limit paths may omit it. Retry only proven reads within a bounded deadline; a mutation is never automatically replayed after an ambiguous response.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED42902"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "description": "Optional server delay in whole seconds or an HTTP date. Absence is not permission for an immediate retry.",
          "schema": {
            "type": "string",
            "examples": [
              "30"
            ]
          }
        }
      }
    },
    "502": {
      "description": "Server-side operation failed.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED50201"
          }
        }
      }
    }
  },
  "x-edoobox-mutates-state": true,
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "data": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "writeOnly": true,
                  "x-edoobox-sensitive": true,
                  "description": "Nur synthetisches Beispiel; tatsächlich zurückgegebenes geschütztes Material sicher übergeben.",
                  "minLength": 100,
                  "maxLength": 150
                },
                "password": {
                  "type": "string",
                  "writeOnly": true,
                  "x-edoobox-sensitive": true,
                  "description": "Neues Passwort: mindestens acht Zeichen mit Klein-/Großbuchstaben, Ziffer und unterstütztem Sonderzeichen; Trivialpasswortliste wird geprüft. Der Server trimmt das Passwort.",
                  "minLength": 8
                }
              },
              "additionalProperties": true,
              "required": [
                "code",
                "password"
              ]
            }
          },
          "additionalProperties": true,
          "required": [
            "data"
          ]
        },
        "example": {
          "data": {
            "code": "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr",
            "password": "Synthetic-Reset-Password-42!"
          }
        }
      },
      "application/x-www-form-urlencoded": {
        "schema": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "writeOnly": true,
              "x-edoobox-sensitive": true,
              "description": "Nur synthetisches Beispiel; tatsächlich zurückgegebenes geschütztes Material sicher übergeben.",
              "minLength": 100,
              "maxLength": 150
            },
            "password": {
              "type": "string",
              "writeOnly": true,
              "x-edoobox-sensitive": true,
              "description": "Neues Passwort: mindestens acht Zeichen mit Klein-/Großbuchstaben, Ziffer und unterstütztem Sonderzeichen; Trivialpasswortliste wird geprüft. Der Server trimmt das Passwort.",
              "minLength": 8
            }
          },
          "additionalProperties": true,
          "required": [
            "code",
            "password"
          ]
        },
        "example": {
          "code": "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr",
          "password": "Synthetic-Reset-Password-42!"
        }
      }
    }
  },
  "x-edoobox-runtimeMutationGuard": false,
  "x-edoobox-documentationReview": {
    "file": "docs/openapi/operation-contracts/05-auth.json",
    "notes": []
  },
  "x-edoobox-source": {
    "file": "application/controllers/V2.php",
    "method": "coreV2",
    "line": 28
  },
  "x-edoobox-documentationStatus": "reviewed",
  "x-edoobox-readOnly": false,
  "x-edoobox-safeForAutomation": false,
  "x-edoobox-permission": {
    "description": "No account-JWT resource permission levels are applied. Authentication requirements, if any, are defined by this route source-specific boundary and dedicated security scheme.",
    "checkedByDispatcher": false,
    "levels": []
  }
}
```
