## Accept (optionally edited), reject or undo a suggestion (desk:write, agent role)

`POST /api/desk/v1/items/{ref}/suggestions/{sid}/{decision}`

Module: Desk · operationId: `decideItemSuggestion` · Tag: AI · Auth: access token (`Authorization: Bearer <accessToken>`)

Accepting a draftReply only records the acceptance (no entry, no mail; the UI puts the text into the reply box), and a draftReply cannot be undone (400).

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `ref` | path | string | yes | Item id or number |
| `sid` | path | string | yes |  |
| `decision` | path | string | yes | (one of `accept`, `reject`, `undo`) |

### Request body

`application/json`

- `payload` (object): Edited proposal (accept only)

Example:

```json
{
  "payload": {
    "text": "WLAN im 2. OG bricht ab: AP-207 startet ständig neu (PoE-Budget des Etagen-Switch überschritten). Switch wird heute getauscht."
  }
}
```

### Responses

- **200** Suggestion (`application/json`)

Fields of the 200 answer:

- `appliedChanges` (array of object): Changes the suggestion made to the item
- `confidence` (number, nullable): Lowest confidence of the decisions; null when the suggestion holds none (e.g. only text read from the ticket)
- `createdAt` (string (date-time)): When it was made
- `decidedAt` (string (date-time)): When it was decided
- `decidedBy` (string): Login (e-mail) of who decided
- `editedPayload` (object): What the person accepted when it differs from the proposal
- `feature` (string): AI feature that made it (one of `triage`, `subject`, `summary`, `draftReply`)
- `feedbackNote` (string): Note with the rating
- `feedbackRating` (integer): Rating of the suggestion
- `id` (string): Id of the suggestion
- `itemId` (string): Item the suggestion is for
- `method` (string): How the ai module answered (e.g. chat)
- `model` (string): Model that answered
- `payload` (object): triage: TriagePayload; others: { text }
- `reason` (string): Why the model proposes it
- `status` (string): State of the suggestion (one of `pending`, `accepted`, `rejected`, `auto_applied`, `superseded`, `undone`)

Example 200 answer:

```json
{
  "confidence": 0.82,
  "createdAt": "2026-11-17T08:42:10Z",
  "feature": "summary",
  "id": "6a3b4c5d-7e8f-4a9b-8c1d-3e4f5a6b7c01",
  "itemId": "4a1b2c3d-5e6f-4a7b-8c9d-1e2f3a4b5c01",
  "method": "llm",
  "model": "medium",
  "payload": {
    "text": "WLAN im 2. OG bricht ab: AP-207 startet ständig neu, weil das PoE-Budget des Etagen-Switch überschritten ist. Austausch des Switch heute 14 Uhr vor Ort."
  },
  "reason": "Aus Beschreibung und internen Notizen zusammengefasst",
  "status": "pending"
}
```

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/desk/v1/items/string/suggestions/string/accept' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"payload":{"text":"WLAN im 2. OG bricht ab: AP-207 startet ständig neu (PoE-Budget des Etagen-Switch überschritten). Switch wird heute getauscht."}}'
```
