apiopenaddproposal browser flow requires login
POST /api/openaddproposal is not an API-key JSON endpoint. It is an authenticated admin/browser route for opening the proposal composer with client data prefilled.
Authentication
The user must already be logged in to the admin app. Send a normal browser form POST; no API key or CSRF token field is required for this route. The route stores sanitized fields in session flash and redirects to /addproposal.
Accepted fields
client, code, person, phone, email, addressClient information shown in the client block of the new proposal form.
vat, website, cityExtra client data. vat maps to the VAT code field and website maps to the website field. city is accepted for future/custom flow use.
name or titleProposal name. If only title is provided, it is used as name.
deadline, comment, template_idDeadline must be parseable as a date. template_id is currently stored only as a sanitized hint.
HTML form example
<form method="post" action="/api/openaddproposal">
<input name="client" value="Example UAB">
<input name="code" value="123456789">
<input name="person" value="John Smith">
<input name="email" value="john@example.com">
<input name="name" value="New proposal for Example UAB">
<button type="submit">Open proposal</button>
</form>
Flow
- Browser posts form data to
/api/openaddproposal. - The route requires
authmiddleware and is excluded from CSRF verification so external browser/admin posts do not need a token. - Only whitelisted scalar fields are stored in session flash.
- The user is redirected to
/addproposal. - The new proposal page fills empty client/proposal fields from the session data.