Files
dashback/docs/api/routes/company/addHistory.md
2026-10-04 11:25:17 +02:00

49 lines
904 B
Markdown

# `POST /company/history`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Add company history entry
Appends an entry to `companyhistory` for the selected company.
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `text` | yes | string | History entry text or note |
```json
{
"text": "…"
}
```
## Response `201`
History entry created
```json
{
"history": {
"id": 1,
"companyuserId": 1,
"date": "2026-08-10T00:00:00.000Z",
"text": "…"
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Text required or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Forbidden — `{"error":"…"}` |
| 500 | Server error — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._